diff --git a/en/device-dev/kernel/figures/icon-note.gif b/en/device-dev/kernel/figures/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..6314297e45c1de184204098efd4814d6dc8b1cda Binary files /dev/null and b/en/device-dev/kernel/figures/icon-note.gif differ diff --git a/en/device-dev/kernel/kernel-small-basic-time.md b/en/device-dev/kernel/kernel-small-basic-time.md index 2918e7f62039e98d996290e3a845487dec14ccba..953fee0f534260aa3bfc0fae3b501e78ab9b0fb9 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,7 +65,7 @@ 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. @@ -75,12 +75,13 @@ The following table describes APIs available for the OpenHarmony LiteOS-A time m >- 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**