aboutsummaryrefslogtreecommitdiff
path: root/src/time.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-10-16 02:08:40 +0200
committerdec05eba <dec05eba@protonmail.com>2022-10-16 04:15:09 +0200
commita7e0dbd83381377bd05a3fa988511d3713996370 (patch)
tree0e18f4c7b95aa4cf79d6646bca77ed5f03c65fb3 /src/time.c
parent93d46b976730bced7a70be1617a0171600167314 (diff)
Refactor xcomposite into abstract capture api
Refactor c++ files into c files, more usable
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;
+}