blob: ce270adf5dc7a0ec19f56833c98723d84e5e33cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#pragma once
#include <stdint.h>
#include <time.h>
#define TIME_JOIN(H, M, S) ((H) * 3600 + (M) * 60 + (S))
#define TIME_AS_FLOAT(T) (((double)T.tv_sec) + ((double)T.tv_nsec / 1000000000.0))
struct timespec get_current_time();
void enable_fake_time();
void progress_time(uint64_t diff);
struct timespec time_from_double(double t);
struct formatted_time {
char buf[32];
};
struct formatted_time format_time(struct timespec time);
struct formatted_time format_duration(struct timespec time);
struct timespec time_sub(const struct timespec *t1, const struct timespec *t2);
|