ulong timer_get_boot_us(void) { static uint64_t base_count; uint64_t count = os_get_nsec(); if (!base_count) base_count = count; return (count - base_count) / 1000; }
ulong get_timer(ulong base) { return (os_get_nsec() / 1000000) - base; }
static int sandbox_timer_get_count(struct udevice *dev, u64 *count) { *count = os_get_nsec() / 1000 + sandbox_timer_offset * 1000; return 0; }
unsigned long __attribute__((no_instrument_function)) timer_get_us(void) { return os_get_nsec() / 1000; }