effect-io-ai

Package: effect
Module: Clock

Clock.currentTimeMillis

Returns an Effect that succeeds with the current time in milliseconds.

When to use

Use to read wall-clock time from the active Clock service with millisecond precision.

Example (Reading milliseconds)

import { Clock, Effect } from "effect"

const program = Effect.gen(function*() {
  const currentTime = yield* Clock.currentTimeMillis
  console.log(`Current time: ${currentTime}ms`)
  return currentTime
})

See

Signature

declare const currentTimeMillis: Effect<number, never, never>

Source

Since v2.0.0