# Measure

`import { Measure } from "destack:bench";`

Benchmark measurement helper.

```ds title="Measure"
export class Measure {
    name: string;
    constructor(name: string);
    iter(body: () => void): Measurement;
    iterAsync(body: () => Promise<void>): Promise<Measurement>;
    blackBox<T>(value: T): T;
    bytes(value: uint64): void;
    items(value: uint64): void;
}
```

[language/library/src/bench/measurement.ds:57:96](https://github.com/destack-sh/destack/blob/main/language/library/src/bench/measurement.ds#L57-L96)

## Members

### `name: string`

Measurement name.

### `constructor(name: string)`

Create a measurement helper.

### `iter(body: () => void): Measurement`

Measure repeated synchronous execution.

### `iterAsync(body: () => Promise<void>): Promise<Measurement>`

Measure repeated asynchronous execution.

### `blackBox<T>(value: T): T`

Preserve a value from optimization.

### `bytes(value: uint64): void`

Record processed bytes.

### `items(value: uint64): void`

Record processed items.
