aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/time.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vppinfra/time.h b/src/vppinfra/time.h
index 3b89cf789fe..3fdc7d43ea8 100644
--- a/src/vppinfra/time.h
+++ b/src/vppinfra/time.h
@@ -242,6 +242,15 @@ unix_time_now_nsec (void)
return 1e9 * ts.tv_sec + ts.tv_nsec;
}
+always_inline void
+unix_time_now_nsec_fraction (u32 * sec, u32 * nsec)
+{
+ struct timespec ts;
+ syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts);
+ *sec = ts.tv_sec;
+ *nsec = ts.tv_nsec;
+}
+
always_inline f64
unix_usage_now (void)
{
@@ -274,6 +283,11 @@ unix_time_now_nsec (void)
return 0;
}
+always_inline void
+unix_time_now_nsec_fraction (u32 * sec, u32 * nsec)
+{
+}
+
always_inline f64
unix_usage_now (void)
{