From 83fabd6919f56a472ff70e8218e794f2784c4ef7 Mon Sep 17 00:00:00 2001 From: valkyrie_pilot Date: Sun, 14 Apr 2024 11:05:56 -0600 Subject: [PATCH] Add README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..20cbf5f --- /dev/null +++ b/README.md @@ -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()); +} +``` \ No newline at end of file