diff --git a/en/device-dev/kernel/kernel-small-basic-time.md b/en/device-dev/kernel/kernel-small-basic-time.md index 2918e7f62039e98d996290e3a845487dec14ccba..c58c25a6c467881bee6b9d4ef72ed8c2d379d8d3 100644 --- a/en/device-dev/kernel/kernel-small-basic-time.md +++ b/en/device-dev/kernel/kernel-small-basic-time.md @@ -1,7 +1,7 @@ # Time Management -## Basic Concepts +## Basic Concepts Time management provides all time-related services for applications based on the system clock. The system clock is generated by the interrupts triggered by the output pulse of a timer or counter. The system clock is generally defined as an integer or a long integer. The period of an output pulse is a "clock tick". The system clock is also called time scale or tick. The duration of a tick can be configured statically. People use second or millisecond as the time unit, while the operating system uses tick. When operations such as suspending a task or delaying a task are performed, the time management module converts time between ticks and seconds or milliseconds. @@ -19,11 +19,11 @@ The mapping between ticks and seconds can be configured. The OpenHarmony time management module provides time conversion, statistics, and delay functions to meet users' time requirements. -## Development Guidelines +## Development Guidelines The time management module provides APIs to implement conversion between the system running time, ticks, and seconds/milliseconds. -### Available APIs +### Available APIs The following table describes APIs available for the OpenHarmony LiteOS-A time management. For more details about the APIs, see the API reference. @@ -65,22 +65,23 @@ The following table describes APIs available for the OpenHarmony LiteOS-A time m -### How to Develop +### How to Develop 1. Call APIs to convert time. 2. Call APIs to perform time statistics. ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](public_sys-resources/icon-note.gif) **NOTE**
>- The system tick count can be obtained only after the system clock is enabled. >- The time management module depends on **OS\_SYS\_CLOCK** and **LOSCFG\_BASE\_CORE\_TICK\_PER\_SECOND** in **los\_config.h**. >- The number of system ticks is not counted when the interrupt feature is disabled. Therefore, the number of ticks cannot be used as the accurate time. -### Development Example +### Development Example -Prerequisites: +**Prerequisites**
+The following parameters are configured: -- **LOSCFG\_BASE\_CORE\_TICK\_PER\_SECOND**, that is, the number of ticks per second in the system, is configured. -- **OS\_SYS\_CLOCK**, that is, system clock \(in Hz\), is configured. +- **LOSCFG\_BASE\_CORE\_TICK\_PER\_SECOND**: number of ticks per second in the system. The value range is (0, 1000]. +- **OS\_SYS\_CLOCK**: system clock, in Hz. **Sample Code**