[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [defer](./js-utils.defer.md)
## defer() function
Resolve after a set amount of time.
Signature:
```typescript
export declare function defer(ms: number, val?: T): Promise;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ms | number | |
| val | T | |
Returns:
Promise<T>