diff --git a/en/application-dev/reference/apis/js-apis-timer.md b/en/application-dev/reference/apis/js-apis-timer.md
index a7265c4972c52318d2f624939e935e56abdb2e63..e85037469d3dd0d931ea7de0a37df77d35880bae 100644
--- a/en/application-dev/reference/apis/js-apis-timer.md
+++ b/en/application-dev/reference/apis/js-apis-timer.md
@@ -1,261 +1,137 @@
-# Timer
+# Timer
-> **NOTE:**
->The initial APIs of this module are supported since API version 4. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+> **NOTE:** The initial APIs of this module are supported since API version 4. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-## Module to Import
+## Module to Import
None
-## Required Permissions
+## Required Permissions
None
-## setTimeout
+## setTimeout
-setTimeout\(handler\[,delay\[, ...args\]\]\): number
+setTimeout(handler[,delay[, ...args]]): number
Sets a timer for the system to call a function after the timer goes off.
-- Parameters
-
-
-
Name
- |
- Type
- |
- Mandatory
- |
- Description
- |
-
-
- handler
- |
- Function
- |
- Yes
- |
- Function to be called after the timer goes off.
- |
-
- delay
- |
- number
- |
- No
- |
- Number of milliseconds delayed before the execution. If this parameter is left empty, the default value 0 is used, which means that the execution starts immediately or as soon as possible.
- |
-
- ...args
- |
- Array<any>
- |
- No
- |
- Additional parameter to pass to the handler after the timer goes off.
- |
-
-
-
-
-- Return Value
-
-
- Type
- |
- Description
- |
-
-
- number
- |
- Timer ID.
- |
-
-
-
-
-- Example
-
- ```
- export default {
- setTimeOut() {
- var timeoutID = setTimeout(function() {
- console.log('delay 1s');
- }, 1000);
- }
- }
- ```
-
-
-## clearTimeout
-
-clearTimeout\(timeoutID: number\): void
-
-Cancels the timer created via **setTimeout\(\)**.
-
-- Parameter
-
-
- Name
- |
- Type
- |
- Mandatory
- |
- Description
- |
-
-
- timeoutID
- |
- number
- |
- Yes
- |
- ID of the timer to cancel, which is returned by setTimeout()
- |
-
-
-
-
-- Example
-
- ```
- export default {
- clearTimeOut() {
- var timeoutID = setTimeout(function() {
- console.log('do after 1s delay.');
- }, 1000);
- clearTimeout(timeoutID);
- }
+- Parameters
+
+
+
+ | Name | Type | Mandatory | Description |
+ | ------- | ----------- | --------- | ------------------------------------------------------------ |
+ | handler | Function | Yes | Function to be called after the timer goes off. |
+ | delay | number | No | Number of milliseconds delayed before the execution. If this parameter is left empty, the default value **0** is used, which means that the execution starts immediately or as soon as possible. |
+ | ...args | Array\ | No | Additional parameter to pass to the handler after the timer goes off. |
+
+- Return Value
+
+
+
+ | Type | Description |
+ | ------ | ----------- |
+ | number | Timer ID. |
+
+- Example
+
+ ```
+ export default {
+ setTimeOut() {
+ var timeoutID = setTimeout(function() {
+ console.log('delay 1s');
+ }, 1000);
}
- ```
+ }
+ ```
+## clearTimeout
-## setInterval
+clearTimeout(timeoutID: number): void
-setInterval\(handler\[, delay\[, ...args\]\]\): number
+Cancels the timer created via **setTimeout()**.
-Sets a repeating timer for the system to repeatedly call a function at a fixed interval.
+- Parameter
+
+
+
+ | Name | Type | Mandatory | Description |
+ | --------- | ------ | --------- | ------------------------------------------------------------ |
+ | timeoutID | number | Yes | ID of the timer to cancel, which is returned by **setTimeout()** |
+
+- Example
-- Parameters
-
-
- Name
- |
- Type
- |
- Mandatory
- |
- Description
- |
-
-
- handler
- |
- Function
- |
- Yes
- |
- Function to be called repeatedly
- |
-
- delay
- |
- number
- |
- No
- |
- Number of milliseconds delayed before the execution
- |
-
- ...args
- |
- Array<any>
- |
- No
- |
- Additional parameter to pass to the handler after the timer goes off
- |
-
-
-
-
-- Return Value
-
-
- Type
- |
- Description
- |
-
-
- number
- |
- ID of the repeated timer.
- |
-
-
-
-
-- Example
-
- ```
- export default {
- setInterval() {
- var intervalID = setInterval(function() {
- console.log('do very 1s.');
- }, 1000);
- }
+ ```
+ export default {
+ clearTimeOut() {
+ var timeoutID = setTimeout(function() {
+ console.log('do after 1s delay.');
+ }, 1000);
+ clearTimeout(timeoutID);
}
- ```
-
-
-## clearInterval
-
-clearInterval\(intervalID: number\): void
-
-Cancels the repeating timer set via **setInterval\(\)**.
-
-- Parameter
-
-
- Name
- |
- Type
- |
- Mandatory
- |
- Description
- |
-
-
- intervalID
- |
- number
- |
- Yes
- |
- ID of the repeating timer to cancel, which is returned by setInterval().
- |
-
-
-
-
-- Example
-
- ```
- export default {
- clearInterval() {
- var intervalID = setInterval(function() {
- console.log('do very 1s.');
- }, 1000);
- clearInterval(intervalID);
- }
+ }
+ ```
+
+## setInterval
+
+setInterval(handler[, delay[, ...args]]): number
+
+Sets a repeating timer for the system to repeatedly call a function at a fixed interval.
+
+- Parameters
+
+
+
+ | Name | Type | Mandatory | Description |
+ | ------- | ----------- | --------- | ------------------------------------------------------------ |
+ | handler | Function | Yes | Function to be called repeatedly |
+ | delay | number | No | Number of milliseconds delayed before the execution |
+ | ...args | Array\ | No | Additional parameter to pass to the handler after the timer goes off |
+
+- Return Value
+
+
+
+ | Type | Description |
+ | ------ | ------------------------- |
+ | number | ID of the repeated timer. |
+
+- Example
+
+ ```
+ export default {
+ setInterval() {
+ var intervalID = setInterval(function() {
+ console.log('do very 1s.');
+ }, 1000);
}
- ```
+ }
+ ```
+## clearInterval
+clearInterval(intervalID: number): void
+
+Cancels the repeating timer set via **setInterval()**.
+
+- Parameter
+
+
+
+ | Name | Type | Mandatory | Description |
+ | ---------- | ------ | --------- | ------------------------------------------------------------ |
+ | intervalID | number | Yes | ID of the repeating timer to cancel, which is returned by **setInterval()**. |
+
+- Example
+
+ ```
+ export default {
+ clearInterval() {
+ var intervalID = setInterval(function() {
+ console.log('do very 1s.');
+ }, 1000);
+ clearInterval(intervalID);
+ }
+ }
+ ```
\ No newline at end of file