Skip to content

Glossary: System Design Basics in Rust

Clock (injected clock)

Also written: Clock, fake clock, real_clock, Instant

A function returning the current time in seconds, passed into the cache so tests can swap in a fake clock they move by hand. The real clock uses `Instant`, which never jumps backward.

Where the book teaches it

Related terms

TTL (time to live)#[cfg(test)] / #[test]