| 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.
| “ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
| — The Unix Haters' handbook | ||