jiff

Module now

Source
Expand description

Provides a centralized helper for getting the current system time.

We generally rely on the standard library for this, but the standard library (by design) does not provide this for the wasm{32,64}-unknown-unknown targets. Instead, Jiff provides an opt-in js feature that only applies on the aforementioned target. Specifically, when enabled, it assumes a web context and runs JavaScript code to get the current time.

This also exposes a “fallible” API for querying monotonic time. Since we only use monotonic time for managing expiration for caches, in the case where we can’t get monotonic time (easily), we just consider the cache to always be expired. ¯_(ツ)_/¯

Modules§