aboutsummaryrefslogtreecommitdiff
path: root/lib/time.c
blob: 623a696616b87c834b534a071789fe9e71f03ee9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <lib/time.h>

// Difference in Time
// Compute the difference between timespec structs
double diff_time(const struct timespec *time1, const struct timespec *time0) {
  return (time1->tv_sec - time0->tv_sec)
      + (time1->tv_nsec - time0->tv_nsec) / 1000000000.0;
}

// Get Current Time
void get_time(struct timespec *ts) {
  timespec_get(ts, TIME_UTC);
}