summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/cpu/cpu.c')
-rw-r--r--arch/sandbox/cpu/cpu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 3fe99b853d5..eefed2ebd96 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -139,3 +139,14 @@ done:
return 0;
}
+
+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;
+}