For PellesC 6.5 only.
#include <stdio.h>
//#include <sys/time.h>
typedef struct timeval {
long tv_sec;
long tv_usec;
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
int main(int argc, char **argv)
{
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 0;
gettimeofday(&tv, NULL);
if (tv.tv_sec)
printf("%d\n", (long)tv.tv_sec);
return 0;
}
You can test sys/time.h like this
#ifndef _SYS_TIME_H
#define _SYS_TIME_H
typedef struct timeval {
long tv_sec;
long tv_usec;
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif /* _SYS_TIME_H */
This is not used.
typedef struct timezone {
int tz_minuteswest;
int tz_dsttime;
};