> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/browser/api/settimeout.md).

# setTimeout()

[JS](/web/js.md) ⟩ [browser](/web/browser.md) ⟩ [web API](/web/browser/api.md) ⟩ setTimeout

{% hint style="success" %} <mark style="color:yellow;">**sets a timer**</mark> which executes code once the timer expires, cancel the timer with [clearTimeout()](/web/browser/api/cleartimeout.md).
{% endhint %}

{% tabs %}
{% tab title="✨ 範例" %}

* [debounce(f, s)](/web/js/val/func/kind/higher/decorator/debounce-f-s.md) - suspends function calls until a specific period of time.
  {% endtab %}

{% tab title="📘 手冊" %}

* [clearTimeout()](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout)
* [setTimeout()](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout)
  {% endtab %}
  {% endtabs %}
