- 论坛徽章:
- 0
|
man 2 time:
time() returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.
man 2 gettimeofday:
The functions gettimeofday() and settimeofday() can get and set the time as well as a time-
zone. The tv argument is a struct timeval (as specified in <sys/time.h>):
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
and gives the number of seconds and microseconds since the Epoch (see time(2)). The tz argu-
ment is a struct timezone:
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of DST correction */
}; |
|