Lines Matching refs:timer
3 …er** module provides system timer features. You can use the APIs of this module to implement the a…
19 Provides the constants that define the supported timer types.
25 | TIMER_TYPE_REALTIME | number | 1 | CPU time type. (The start time of the timer cannot be later…
28 | TIMER_TYPE_IDLE | number | 8 | Idle timer type (supported only for system services, but no…
38 …timer cannot be later than the current system time.)<br>**2**: wakeup type.<br>**4**: exact type. …
39 …he timer is a repeating timer.<br>The value **true** means that the timer is a repeating timer, an…
40 …timer, the minimum value of **interval** is 1s and the maximum value is 365 days. It is recommende…
41 | wantAgent | WantAgent | No | **WantAgent** object of the notification to be sent when the timer …
49 Creates a timer. This API uses an asynchronous callback to return the result.
57 …Yes | Timer initialization options, including the timer type, whether the timer is a repeating ti…
58 | callback | AsyncCallback<number> | Yes | Callback used to return the timer ID. …
81 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
84 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
88 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
96 Creates a timer. This API uses a promise to return the result.
105 …Yes | Timer initialization options, including the timer type, whether the timer is a repeating ti…
111 | Promise<number> | Promise used to return the timer ID.|
133 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
135 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
139 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
145 startTimer(timer: number, triggerTime: number, callback: AsyncCallback<void>): void
147 Starts a timer. This API uses an asynchronous callback to return the result.
155 | timer | number | Yes | ID of the timer. …
156 … | Yes | Time when the timer is triggered, in milliseconds.<br>If **TIMER_TYPE_REALTIME*…
184 console.info(`Failed to start the timer. Message: ${error.message}, code: ${error.code}`);
187 console.info(`Succeeded in starting the timer.`);
189 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
191 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
195 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
201 startTimer(timer: number, triggerTime: number): Promise<void>
203 Starts a timer. This API uses a promise to return the result.
211 | timer | number | Yes | ID of the timer. …
212 … | number | Yes | Time when the timer is triggered, in milliseconds.<br>If **TIMER_TYPE_REALTIME*…
244 console.info(`Succeeded in starting the timer.`);
246 console.info(`Failed to start the timer. Message: ${error.message}, code: ${error.code}`);
248 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
250 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
254 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
260 stopTimer(timer: number, callback: AsyncCallback<void>): void
262 Stops a timer. This API uses an asynchronous callback to return the result.
270 | timer | number | Yes | ID of the timer.|
299 console.info(`Failed to stop the timer. Message: ${error.message}, code: ${error.code}`);
302 console.info(`Succeeded in stopping the timer.`);
304 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
306 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
310 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
316 stopTimer(timer: number): Promise<void>
318 Stops a timer. This API uses a promise to return the result.
326 | timer | number | Yes | ID of the timer.|
359 console.info(`Succeeded in stopping the timer.`);
361 console.info(`Failed to stop the timer. Message: ${error.message}, code: ${error.code}`);
363 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
365 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
369 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
375 destroyTimer(timer: number, callback: AsyncCallback<void>): void
377 Destroys a timer. This API uses an asynchronous callback to return the result.
385 | timer | number | Yes | ID of the timer.|
415 console.info(`Failed to destroy the timer. Message: ${error.message}, code: ${error.code}`);
418 console.info(`Succeeded in destroying the timer.`);
420 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
422 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
426 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
432 destroyTimer(timer: number): Promise<void>
434 Destroys a timer. This API uses a promise to return the result.
442 | timer | number | Yes | ID of the timer.|
476 console.info(`Succeeded in destroying the timer.`);
478 console.info(`Failed to destroy the timer. Message: ${error.message}, code: ${error.code}`);
480 console.info(`Succeeded in creating a timer. timerId: ${timerId}`);
482 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);
486 console.info(`Failed to create a timer. Message: ${error.message}, code: ${error.code}`);