Core - v1.0.0
    Preparing search index...

    Class Time

    Clock helpers used by the framework layer.

    One place that reads the clock, so timestamps agree across a request: the logger stamps every line, the middleware measures duration, and a service records when a row was written. Some runtimes freeze Date.now() between I/O operations, so a duration measured across an await is wall-clock time around the I/O rather than CPU time.

    const start = Time.now()
    await handler()
    log.info('done', { durationMs: Time.since(start), at: Time.nowIso() })

    Bayu Dwiyan Satria

    1.0.0

    1.0.0

    Index
    • Reads the current time in epoch milliseconds.

      Returns number

      Milliseconds since the epoch.

    • Reads the current time as an ISO 8601 string.

      Returns string

      The timestamp, e.g. 2026-07-26T09:12:44.031Z.

    • Measures how long has passed since a mark taken with Time.now.

      Parameters

      • start: number

        The earlier mark, in epoch milliseconds.

      Returns number

      Elapsed milliseconds, never negative.