时间单位

用户空间公开时间单位

zx_time_t 以纳秒为单位。

使用 zx_clock_get_monotonic() 获取当前时间(自启动以来经过的纳秒数)。

内核内部时间单位

lk_time_t 以纳秒为单位。

编写将在内核中运行的代码时,如需读取当前的单调时钟值,请使用:

#include <platform.h>

lk_time_t current_time(void);