diff --git a/docs/en/c_utils_timer.md b/docs/en/c_utils_timer.md index 5945f9e6e9253ecbfeb4159f1c44194ee85c999e..b83ed4b8051f1dcb6f964d53d2e58dbecc61caee 100644 --- a/docs/en/c_utils_timer.md +++ b/docs/en/c_utils_timer.md @@ -3,6 +3,10 @@ ### Introduction This is a timer manager. After "Timer" started, users can register several timed events, which can be continuous or once, to it. +- Timer is a millisecond-level high-precision timer, which is generally used for short-term timing tasks. It is not recommended for long-term timing tasks, otherwise it will bring a certain performance burden. + +- As a timer in user mode, Timer does not have the ability to wake up in the sleep state, and cannot perform normal counting functions in the sleep state. + `#include ` ## Related Interfaces @@ -34,4 +38,6 @@ run -t UT -tp utils -ts UtilsTimerTest 1. Set up Timer again would not reset this Timer, but return `TIMER_ERR_INVALID_VALUE`. If a reset operation is required, shut Timer down first and then set it up. -1. Parameter in Shutdown() determines whether the thread in Timer would be detach or join. (True(default) --> join; False --> detach). Detach operation would cause possible multithreading problems, thus is not recommended. If a detach operation is required, availability of related objects used in `thread_` should be guaranteed. \ No newline at end of file +1. Parameter in Shutdown() determines whether the thread in Timer would be detach or join. (True(default) --> join; False --> detach). Detach operation would cause possible multithreading problems, thus is not recommended. If a detach operation is required, availability of related objects used in `thread_` should be guaranteed. + +1. If the system sleeps during the scheduled task, the Timer cannot wake up automatically during the sleep phase, and will not perform counting operations, which will cause abnormal timing results. \ No newline at end of file diff --git a/docs/zh-cn/c_utils_timer.md b/docs/zh-cn/c_utils_timer.md index db1e2192a41d82affdff4bbc0d76ee4d87d93204..feaebea51f154eeee5b938a136e7eb037beb85cd 100644 --- a/docs/zh-cn/c_utils_timer.md +++ b/docs/zh-cn/c_utils_timer.md @@ -3,6 +3,10 @@ ### 简介 定时器管理器,Timer启动后,可向定时器中注册多个定时事件,定时事件可以单次触发也可连续执行。 +- Timer为毫秒级的高精度定时器,一般应用于短时的定时任务,不推荐应用于长时间的定时任务中,否则会带来一定的性能负担。 + +- Timer作为用户态的定时器没有在休眠状态下唤醒的能力,在休眠状态下无法进行正常的计数功能。 + `#include ` ## 涉及功能 @@ -35,4 +39,6 @@ run -t UT -tp utils -ts UtilsTimerTest 1. 重复设置Timer不会重置Timer的状态,Setup()接口会返回TIMER_ERR_INVALID_VALUE。 如果需要重置,那么请先关闭Timer再设置。 -1. Shutdown接口的参数决定了Timer中的线程的阻塞与否,默认阻塞(true),若为false则非阻塞。非阻塞选项 可能会导致线程问题,因此不推荐。如果一定要使用非阻塞选项,请自行保证线程中对象的生命周期。 \ No newline at end of file +1. Shutdown接口的参数决定了Timer中的线程的阻塞与否,默认阻塞(true),若为false则非阻塞。非阻塞选项 可能会导致线程问题,因此不推荐。如果一定要使用非阻塞选项,请自行保证线程中对象的生命周期。 + +1. 如果定时任务中发生系统休眠,在休眠阶段Timer无法自唤醒,不会执行计数操作,因此会导致计时结果异常。 \ No newline at end of file