Skip to main content

Import

Profiler

Accumulates named timing measurements and produces a summary.

Constructor

Methods

Example


Debug utilities

Standalone timing functions from bytekit/debug for one-off measurements without managing a Profiler instance.

createStopwatch

Creates a manual stopwatch for fine-grained control.

Options

Stopwatch methods

Example

withTiming

Wraps an async function and logs its execution time.

Example

measureSync

Measures a synchronous function and returns its result.

Example

measureAsync

Measures an async function and returns both the result and the duration.

Example

captureDebug

Captures timing information for an async operation without a label.

Example

Choosing the right tool

You need to accumulate multiple named measurements across a workflow and produce a summary at the end — for example, profiling an entire request lifecycle.
You want manual start/stop control over a single measurement with optional automatic logging.
You want a one-liner that wraps an existing function call and logs or returns the duration.
You need a quick timing capture without labels or logging — useful in tests and diagnostics.
Combine Profiler with the Logger to ship timing data to your observability stack.