summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index e131ca41..6aedcfb6 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -171,6 +171,19 @@ times_update_real_time(struct timeloop *loop)
loop->real_time = ts.tv_sec S + ts.tv_nsec NS;
}
+btime
+current_time_now(void)
+{
+ struct timespec ts;
+ int rv;
+
+ rv = clock_gettime(CLOCK_MONOTONIC, &ts);
+ if (rv < 0)
+ die("clock_gettime: %m");
+
+ return ts.tv_sec S + ts.tv_nsec NS;
+}
+
/**
* DOC: Sockets