aboutsummaryrefslogtreecommitdiff
path: root/src/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time.c')
-rw-r--r--src/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/time.c b/src/time.c
new file mode 100644
index 0000000..b2dcdea
--- /dev/null
+++ b/src/time.c
@@ -0,0 +1,10 @@
+#include "../include/time.h"
+#include <time.h>
+
+double clock_get_monotonic_seconds() {
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return (double)ts.tv_sec + (double)ts.tv_nsec * 0.000000001;
+}