> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# clearTimeout() global function

APISummary
Cancel the timer set by `setTimeout`.

## Syntax

```typescript
  clearTimeout(timerId: number): void;
```

### Parameter

#### timerId

The timer ID returned by `setTimeout`.
If the timer corresponding to this ID has already finished executing, the method will not perform any action.

\*\* Passing in an ID value that is not returned by `setTimeout` is undefined behavior and may cause problems. \*\*

## Example

## Notes

1. `setTimeout()` and `setInterval()` have a shared pool of ID numbers, so technically `clearTimeout()` and `clearInterval()` are interchangeable. However, for clarity, you should avoid doing so.

## Compatibility

**Compatibility Table**

**Query:** `lynx-api.global.clearTimeout`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/global/clearTimeout.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| clearTimeout | Yes (1.3) | Yes (3.4) | Yes (1.3) | Yes (3.5) | Yes (3.5) | Yes |

**`clearTimeout`**

Cancel the timer set by `setTimeout`.

**Specifications:**

