Skip to content

Commit

Permalink
add example output
Browse files Browse the repository at this point in the history
  • Loading branch information
jftuga committed Oct 23, 2023
1 parent 55bbdf1 commit 760ee22
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ func main() {
}
```

Output:

```
$ go run small.go
ttlMap length: 2
[ myString] a b c
[int_array] [1 2 3]
Sleeping 5 seconds, items should be 'nil' after this time
[ myString] <nil>
[int_array] <nil>
ttlMap length: 0
```

## Performance
* Searching for expired items runs in O(n) time, where n = number of items in the `ttlMap`.
* * This inefficiency can be somewhat mitigated by increasing the value of the `pruneInterval` time.
Expand Down

0 comments on commit 760ee22

Please sign in to comment.