The precision of this implmentation is 10ms. Not sure how to do with the
possible data race.
Signed-off-by: Zhaoming Luo <zhmingluo@163.com>
---
include/mach/mach_host.defs | 7 +++++++
kern/mach_clock.c | 20 ++++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs
index 8fd9d6b3..67f72cda 100644
--- a/include/mach/mach_host.defs
+++ b/include/mach/mach_host.defs
@@ -386,3 +386,10 @@ routine host_adjust_time64(
routine host_get_kernel_version(
host : host_t;
out kernel_version : new_kernel_version_t);
+
+/*
+ * Get the elapsed time on this host.
+ */
+routine host_get_elapsed_time(
+ host : host_t;
+ out elapsed_time : time_value_t);