Skip to content

Clock = () => number

Defined in: packages/cache/src/cache.ts:9

Read the current time, in milliseconds on the caller’s own scale.

Only differences between readings matter, so a monotonic clock (performance.now) and a wall clock (Date.now) both work. The cache never reads time on its own: injecting the clock keeps every expiry decision replayable in a test.

number