ui.util.setInterval
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wielokrotnie wywołuje funkcję ze stałym opóźnieniem między wywołaniami.
Zwraca klucz, który można przekazać do ui.util.clearTimeout, aby usunąć limit czasu.
Wykorzystanie | Zwroty |
---|
ui.util.setInterval(func, delay) | Liczba |
Argument | Typ | Szczegóły |
---|
func | Funkcja | Funkcja, która ma zostać uruchomiona po określonym opóźnieniu. |
delay | Liczba | Czas (w milisekundach) opóźnienia między wykonaniami określonej funkcji. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eui.util.setInterval\u003c/code\u003e repeatedly executes a provided function at a fixed time interval.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a unique key that can be used with \u003ccode\u003eui.util.clearTimeout\u003c/code\u003e to cancel the interval timer.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edelay\u003c/code\u003e argument specifies the time in milliseconds between each function execution.\u003c/p\u003e\n"]]],["The core content describes the `ui.util.setInterval` function, which repeatedly executes a provided function (`func`) at a specified time interval (`delay`, in milliseconds). It returns a numerical key. This key is then usable with `ui.util.clearTimeout` to cancel the recurring function calls. The function establishes a recurring timer with the specified delay between executions.\n"],null,["# ui.util.setInterval\n\n\u003cbr /\u003e\n\nRepeatedly calls a function with a fixed time delay between each call.\n\n\u003cbr /\u003e\n\nReturns a key that can be passed to ui.util.clearTimeout to remove the timeout.\n\n| Usage | Returns |\n|------------------------------------|---------|\n| `ui.util.setInterval(func, delay)` | Number |\n\n| Argument | Type | Details |\n|----------|----------|------------------------------------------------------------------------------------------------------------------------------|\n| `func` | Function | The function to run after the specified delay. |\n| `delay` | Number | The time, in milliseconds (thousandths of a second), the timer should delay in between executions of the specified function. |"]]