aboutsummaryrefslogtreecommitdiff
path: root/src/time.c
blob: b2dcdeab40755cd70721eb144a88f9753aa619e8 (plain)
1
2
3
4
5
6
7
8
9
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;
}