--- title: WindowTimers slug: Web/API/WindowTimers translation_of: Web/API/WindowOrWorkerGlobalScope translation_of_original: Web/API/WindowTimers ---
{{APIRef("HTML DOM")}}

WindowTimers is a mixin used to provide utility methods which set and clear timers. No objects of this type exist; instead, its methods are available on {{domxref("Window")}} for the standard browsing scope, or on {{domxref("WorkerGlobalScope")}} for workers.

屬性

WindowTimers 介面沒有繼承也沒有定義任何屬性。

方法

除以下自身方法外,WindowTimers 介面提沒有任何繼承方法。

{{domxref("WindowTimers.clearInterval()")}}
Cancels the repeated execution set using {{domxref("WindowTimers.setInterval()")}}.
{{domxref("WindowTimers.clearTimeout()")}}
Cancels the delayed execution set using {{domxref("WindowTimers.setTimeout()")}}.
{{domxref("WindowTimers.setInterval()")}}
Schedules a function to execute every time a given number of milliseconds elapses.
{{domxref("WindowTimers.setTimeout()")}}
Schedules a function to execute in a given amount of time.

規範

Specification Status Comment
{{SpecName('HTML WHATWG', '#windowtimers', 'WindowTimers')}} {{Spec2('HTML WHATWG')}} No change since the latest snapshot, {{SpecName("HTML5.1")}}.
{{SpecName('HTML5.1', '#windowtimers', 'WindowTimers')}} {{Spec2('HTML5.1')}} Snapshot of {{SpecName("HTML WHATWG")}}. No change.
{{SpecName("HTML5 W3C", "#windowtimers", "WindowTimers")}} {{Spec2('HTML5 W3C')}} Snapshot of {{SpecName("HTML WHATWG")}}. Creation of WindowBase64 (properties where on the target before it).

瀏覽器相容性

{{CompatibilityTable}}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{CompatGeckoDesktop(1)}} 1.0 4.0 4.0 1.0
Feature Firefox Mobile (Gecko) Android IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatGeckoMobile(1)}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

 

參見