---
title: "ChunkRate: interface in Runtime, TypeShade API reference"
description: "ChunkRate, an interface in Runtime. What a device measured of one chunk key: the time one unit takes, as the device learned it from the chunks so far…"
url: https://typeshade.dev/api/chunkrate/
language: en
---

# `ChunkRate`

Interface in Runtime

What a device measured of one chunk key: the time one unit takes, as the device learned it from the chunks so far, how many chunks it ran, the longest of them and the units of the last one.

`import type { ChunkRate } from 'typeshade'`
`import type { ChunkRate } from 'typeshade/runtime'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface ChunkRate {
  readonly msPerUnit: number;
  readonly chunks: number;
  readonly longestMs: number;
  readonly lastUnits: number;
}
```

## Description

`device.chunkRates` holds one for each key a chunked plan named.

## Instance properties

**`msPerUnit` read only `number`**

The milliseconds one unit takes: the first chunk’s measured rate, then the mean of the previous rate and the measured one.

**`chunks` read only `number`**

How many chunks of the key the device ran.

**`longestMs` read only `number`**

The longest time one chunk of the key took, in milliseconds.

**`lastUnits` read only `number`**

The units of the last chunk, at least 1.

## Source

[`src/runtime/chunk.ts`, line 21](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/chunk.ts#L21), at commit af54ddad5
