> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# computeBackoff()

> Function exported by @botmesh/core/spi.

```ts theme={null}
function computeBackoff(
   policy, 
   attempt, 
   random?
): number;
```

Defined in: [durability/backoff.ts:23](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/backoff.ts#L23)

Delay in ms before the next attempt, after `attempt` (1-based) failed attempts.
Capped exponential with symmetric jitter; a function policy is called as-is.
Never negative; non-finite results become `0`.

## Parameters

| Parameter | Type | Default value |
| - | - | - |
| `policy` | [`RetryBackoff`](https://botmesh.afaya.com.co/api/core/type-aliases/RetryBackoff) \| `undefined` | `undefined` |
| `attempt` | `number` | `undefined` |
| `random?` | () => `number` | `Math.random` |

## Returns

`number`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.