From 4e50857a5585066be19054a21dd3afd3b9223a3b Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Tue, 14 Jun 2022 21:16:54 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- en/device-dev/kernel/figures/icon-note.gif | Bin 0 -> 394 bytes .../kernel/kernel-small-basic-time.md | 17 +++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 en/device-dev/kernel/figures/icon-note.gif 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 GIT binary patch literal 394 zcmZ?wbhEHblx7fPSjxcg=ii?@_wH=jwxy=7CMGH-B`L+l$wfv=#>UF#$gv|VY%C^b zCQFtrnKN(Bo_%|sJbO}7RAORe!otL&qo<>yq_Sq+8Xqqo5h0P3w3Lvb5E(g{p01vl zxR@)KuDH0l^z`+-dH3eaw=XqSH7aTIx{kzVBN;X&hha0dQSgWuiw0NWUvMRmkD|> literal 0 HcmV?d00001 diff --git a/en/device-dev/kernel/kernel-small-basic-time.md b/en/device-dev/kernel/kernel-small-basic-time.md index 2918e7f620..953fee0f53 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** -- GitLab