Files
el/lang/tests/time/examples/ttl-cache.el
T
2026-05-05 01:38:51 -05:00

15 lines
444 B
EmacsLisp

// ttl-cache.el TTL helpers backed by typed Duration. Storing under a key
// stamps the set time as an Instant; ttl_cache_get computes the age and
// returns the value only if the age is within the supplied Duration.
// `test` is reserved; using `run_test` instead.
fn run_test() -> String {
ttl_cache_set("key1", "hello")
let v: String = ttl_cache_get("key1", 1.hour)
return v
}
fn main() -> Void {
println(run_test())
}