Name | Description | Notes | Source | Availability | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
asctime() |
Convert time to string | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
asctime_s() |
Convert time to string | (·) | <time.h> |
C11 | |||||||
CLOCKS_ |
Granularity of execution-time clock | M | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
clock() |
Get execution time | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
clock_t |
Execution-time type | T | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
ctime() |
Convert time to string | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
ctime_s() |
Convert time to string | (·) | <time.h> |
C11 | |||||||
difftime() |
Compare times | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
errno_t |
Error-number type | ? | T | Headers | C11 | ||||||
gmtime() |
Convert calendar time to UTC | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
gmtime_s() |
Convert calendar time to UTC | (·) | <time.h> |
C11 | |||||||
localtime() |
Convert calendar time to local time | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
localtime_s() |
Convert calendar time to local time | (·) | <time.h> |
C11 | |||||||
mktime() |
Create calendar time | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
NULL |
Null pointer constant | L | M | Headers | C89 | C90 | C95 | C99 | C11 | ||
rsize_t |
Implementation-defined size type with implied run-time constraints | L | ? | T | Headers | C11 | |||||
size_t |
Implementation-defined size type | H | T | Headers | C89 | C90 | C95 | C99 | C11 | ||
strftime() |
Convert time to string | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
struct
timespec |
Nanosecond time type | T | <time.h> |
C11 | |||||||
struct
tm |
Time type | T | Headers | C89 | C90 | C95 | C99 | C11 | |||
TIME_ |
Indicator for UTC time in struct
timespec |
M | <time.h> |
C11 | |||||||
time() |
Get calendar time | (·) | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
time_t |
Calendar-time type | T | <time.h> |
C89 | C90 | C95 | C99 | C11 | |||
timespec_ |
Read nanosecond time | (·) | <time.h> |
C11 |
C supports several concepts of time. Program duration is available, indicating how long the program has been running. Real time is available too, in both arithmetic (timezone-independent) and structural forms, with functions to convert them to strings. Nanosecond timing is available for threading operations.
Most of these facilities are available in <time.h>
.