| Functions | ||||
| Time manipulation | ||||
timespec_get (C11) | ||||
(C23) | ||||
| Format conversions | ||||
(deprecated in C23)(C11) | ||||
(deprecated in C23)(C11) | ||||
(C95) | ||||
(C23)(C11) | ||||
(C23)(C11) | ||||
| Constants | ||||
| Types | ||||
(C11) |
Defined in header <time.h> | ||
int timespec_get(struct timespec*ts,int base); | (1) | (since C11) |
#define TIME_UTC /* implementation-defined */ | (2) | (since C11) |
timespec_getOther macro constants beginning withTIME_ may be provided by the implementation to indicate additional time bases
Ifbase isTIME_UTC, then
Contents |
| ts | - | pointer to an object of typestruct timespec |
| base | - | TIME_UTC or another nonzero integer value indicating the time base |
The value ofbase if successful, zero otherwise.
The POSIX functionclock_gettime(CLOCK_REALTIME, ts) may also be used to populate atimespec with the time since the Epoch.
Possible output:
Current time: 02/18/15 14:34:03.048508855 UTC
(C11) | time in seconds and nanoseconds (struct)[edit] |
(C23) | returns the resolution of calendar time based on a given time base (function)[edit] |
| returns the current calendar time of the system as time since epoch (function)[edit] | |
C++ documentation fortimespec_get | |