Skip to main content

set_clock

Function set_clock 

Source
pub fn set_clock(now_ms: fn() -> i64)
Expand description

Gives the crate its clock, in Unix milliseconds. Only the first call counts.

Needed on wasm32 without the js feature, where the crate has no clock of its own (Expo’s Exact gives its own). Without it, the time is 0 there: a server token is refreshed only after a 401, and the mirror’s repair sync removes no stale items and reports Synced(0). On other builds the clock replaces the system one.