---
title: Duration
description: Seconds, plus how we know them.
---

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.

## Accessors

### isMeasured

#### Get Signature

```ts
get isMeasured(): boolean;
```

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

##### Returns

`boolean`

***

### provenance

#### Get Signature

```ts
get provenance(): string;
```

`"measured"` or `"projected"`.

##### Returns

`string`

***

### seconds

#### Get Signature

```ts
get seconds(): number;
```

The span in seconds, without its label.

##### Returns

`number`

## Methods

### toString()

```ts
toString(): string;
```

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

#### Returns

`string`

***

### measured()

```ts
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.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `seconds` | `number` |

#### Returns

`Duration`

***

### projected()

```ts
static projected(seconds: number): Duration;
```

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

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `seconds` | `number` |

#### Returns

`Duration`

## Provenance

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.