Date and Time: time.h
The time.h header file defines two macros. The first, also defined in many other header files, is NULL, representing the null pointer. The second macro is CLOCKS_PER_SEC; dividing the value returned by clock() by this macro yields time in seconds.
The header file defines the types listed in Table F.17.
Type | Description |
---|---|
size_t | The integer type returned by the sizeof operator. |
clock_t | An arithmetic type suitable to represent time. |
time_t | An arithmetic type suitable to represent time. |
struct tm | A structure type for holding components of calendar time. |
The components of the calendar type are referred to as broken-down time. Table F.18 lists the required members of a struct tm structure.
Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.