Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
randomairborne committed Apr 14, 2024
1 parent e35988b commit 83fabd6
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
@@ -0,0 +1,15 @@
# expiringmap

A rust library implementing a TTL map.

```rust
use std::time::Duration;
use expiringmap::ExpiringMap;

fn main() {
let mut map = ExpiringMap::new();
map.insert("key", "value", Duration::from_millis(50));
std::thread::sleep(Duration::from_millis(60));
assert!(map.get(&"key").is_none());
}
```

0 comments on commit 83fabd6

Please sign in to comment.