Package: effect
Module: Clock
Returns an Effect that succeeds with the current time in nanoseconds.
When to use
Use to read wall-clock time from the active Clock service with nanosecond
precision.
Example (Reading nanoseconds)
import { Clock, Effect } from "effect"
const program = Effect.gen(function*() {
const currentTime = yield* Clock.currentTimeNanos
console.log(`Current time: ${currentTime}ns`)
return currentTime
})
Signature
declare const currentTimeNanos: Effect<bigint, never, never>
Since v2.0.0