---
title: "Helpers/async"
---
# Helpers/async

### setTimeout()

**setTimeout**\<`T`\>(`callback`, `timeout`, ...`args`): `number`

Defined in: [src/core/helpers/async/set-timeout.ts:16](https://github.com/xdan/jodit/blob/main/src/core/helpers/async/set-timeout.ts#L16)

Create async callback if set timeout value - else call function immediately

#### Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| `T` | `any` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `callback` | (...`args`) => `void` |
| `timeout` | `number` |
| ...`args` | `T`[] |

#### Returns

`number`

***

### clearTimeout()

**clearTimeout**(`timer`): `void`

Defined in: [src/core/helpers/async/set-timeout.ts:33](https://github.com/xdan/jodit/blob/main/src/core/helpers/async/set-timeout.ts#L33)

Clear timeout

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `timer` | `number` |

#### Returns

`void`
