Hyperlinkv0.8.0-beta.28

Console

Console.timeLogconsteffect/Console.ts:502
(label?: string, ...args: ReadonlyArray<any>): Effect.Effect<void>

Logs the elapsed time for an existing timer without stopping it, allowing progress reports for long-running operations.

Example (Logging timer progress)

import { Console, Effect } from "effect"

const program = Effect.gen(function*() {
  yield* Effect.scoped(
    Effect.gen(function*() {
      yield* Console.time("long-operation")
      yield* Effect.sleep("500 millis")
      yield* Console.timeLog("long-operation", "Halfway done")
      yield* Effect.sleep("500 millis")
      // Timer ends when scope closes
    })
  )
})
accessors
Source effect/Console.ts:5026 lines
export const timeLog = (label?: string, ...args: ReadonlyArray<any>): Effect.Effect<void> =>
  consoleWith((console) =>
    effect.sync(() => {
      console.timeLog(label, ...args)
    })
  )