Skip to content

Duration

Seconds, plus how we know them.

No constructor: Duration.measured(s) and Duration.projected(s) are the only doors, so a provenance cannot be omitted. See the module docs.

get isMeasured(): boolean;

True only for a timed span. What CostReport.fullyMeasured reads.

boolean


get provenance(): string;

"measured" or "projected".

string


get seconds(): number;

The span in seconds, without its label.

number

toString(): string;

Ns (provenance) — the label travels with the figure.

string


static measured(seconds: number): Duration;

A timed phase: a clock ran and this is what it read.

Fallible because the float is — a negative or non-finite figure has no reading as a duration, and the refusal is the core’s, message and all.

Parameter Type
seconds number

Duration


static projected(seconds: number): Duration;

A hypothetical phase: an estimate’s input, or a documented minimum nobody timed.

Parameter Type
seconds number

Duration

This page is generated from bindings/microvms-js/index.d.ts by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run dts. mise run dts:check fails when the committed file no longer matches the source.