Closed sergeyklay closed 3 years ago
Thanks!
Eh no you are wrong, this broke everything. On linux and bsd it's in time.h
See here for example https://www.unix.com/man-page/FreeBSD/2/clock_gettime/
@rigtorp Yes, clock_gettime is from time.h, my bad. But,
BSD
$ man gettimeofday | head
GETTIMEOFDAY(2) BSD System Calls Manual GETTIMEOFDAY(2)
NAME
gettimeofday, settimeofday -- get/set date and time
SYNOPSIS
#include <sys/time.h>
int
Linux
$ man gettimeofday | head
GETTIMEOFDAY(2) Linux Programmer's Manual GETTIMEOFDAY(2)
NAME
gettimeofday, settimeofday - get / set time
SYNOPSIS
#include <sys/time.h>
int gettimeofday(struct timeval *restrict tv,
struct timezone *restrict tz);
As you can see bot Linux and BSD say gettimeofday from sys/time.h, not time.h.
Yeah I updated the code to include both.
As *BSD and Linux man says, gettimeofday is from sys/time.h, not time.h