MCPcopy Create free account
hub / github.com/boostorg/build / timestamp_current

Function timestamp_current

src/engine/timestamp.cpp:114–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114void timestamp_current( timestamp * const t )
115{
116#ifdef OS_NT
117 /* GetSystemTimeAsFileTime()'s resolution seems to be about 15 ms on Windows
118 * XP and under a millisecond on Windows 7.
119 */
120 FILETIME ft;
121 GetSystemTimeAsFileTime( &ft );
122 timestamp_from_filetime( t, &ft );
123#elif defined(_POSIX_TIMERS) && defined(CLOCK_REALTIME) && \
124 (!defined(__GLIBC__) || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17))
125 /* Some older versions of XCode define _POSIX_TIMERS, but don't actually
126 * have clock_gettime. Check CLOCK_REALTIME as well. Prior to glibc 2.17,
127 * clock_gettime requires -lrt. This is a non-critical feature, so
128 * we just disable it to keep bootstrapping simple.
129 */
130 struct timespec ts;
131 clock_gettime( CLOCK_REALTIME, &ts );
132 timestamp_init( t, ts.tv_sec, ts.tv_nsec );
133#else /* OS_NT */
134 timestamp_init( t, time( 0 ), 0 );
135#endif /* OS_NT */
136}
137
138
139int timestamp_empty( timestamp const * const time )

Callers 6

make1cFunction · 0.85
exec_cmdFunction · 0.85
exec_waitFunction · 0.85
exec_cmdFunction · 0.85
mainFunction · 0.85
reportWindowsErrorFunction · 0.85

Calls 2

timestamp_from_filetimeFunction · 0.85
timestamp_initFunction · 0.85

Tested by

no test coverage detected