Main index | Section 3 | Options |
#include <sys/time.h>
struct timeval { long tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* and microseconds */ };And the timespec structure is defined in <time.h> as:
struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ };
timeradd() and timespecadd() add the time information stored in a to b and store the result in res. The results are simplified such that the value of res->tv_usec or res->tv_nsec is always less than 1 second.
timersub() and timespecsub() subtract the time information stored in b from a and store the result in res.
timerclear() and timespecclear() initialize their argument to midnight (0 hour) January 1st, 1970 (the Epoch).
timerisset() and timespecisset() return true if their argument is set to any time value other than the Epoch.
timercmp() and timespeccmp() compare a to b using the comparison operator given in CMP, and return the result of that comparison.
TIMERADD (3) | July 30, 2018 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | "I liken starting one's computing career with Unix, say as an undergraduate, to being born in East Africa. It is intolerably hot, your body is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act." | ” |
— Ken Pier, Xerox PARC |