Time units

July 8, 2022 ยท View on GitHub

Userspace exposed time units

zx_time_t is in nanoseconds.

Use zx_clock_get_monotonic() to get the current time as the number of nanoseconds since boot.

Kernel-internal time units

lk_time_t is in nanoseconds.

When writing code that will run in the kernel, to read the current monotonic clock value, use:

#include <platform.h>

lk_time_t current_time(void);

Contents

  1. 1Userspace exposed time units
  2. 2Kernel-internal time units