Registry / Library

library · v0.1.0
FreshClock
Advance an already calculated HTTP cache age on a monotonic clock.
Use FreshClock
use vendor::freshclock::freshclock;
Run the example
nest demo freshclock@0.1.0
blyxc native-run freshclock-demo/main.blyx
Example source and expected output
use vendor::freshclock::freshclock;
fn main() {
let age_at_store = 4.0;
let stored = 100.0;
let now = 110.0;
let lifetime = 20.0;
let result = freshclock_age(age_at_store, stored, now, lifetime);
if len(result) == 0 { println!("invalid"); return; }
let mut i = 0;
while i < len(result) {
println!(at(result, i));
i += 1;
}
}
Expected output
14
6
0
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.0 | Download ZIP | 61e782da4e | fff93c74ba84be28b5fd33d36fc10bb799ab9e6eef2110a0eec6db73c7858693 |