MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getCurrentTime

Function getCurrentTime

src/common/classes/semaphore.cpp:44–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42#if defined(COMMON_CLASSES_SEMAPHORE_POSIX_RT) || defined(COMMON_CLASSES_SEMAPHORE_COND_VAR)
43
44static timespec getCurrentTime()
45{
46 timespec rc;
47
48#ifdef HAVE_GETTIMEOFDAY
49 struct timeval tp;
50 GETTIMEOFDAY(&tp);
51 rc.tv_sec = tp.tv_sec;
52 rc.tv_nsec = tp.tv_usec * 1000;
53#else
54 struct timeb time_buffer;
55 ftime(&time_buffer);
56 rc.tv_sec = time_buffer.time;
57 rc.tv_nsec = time_buffer.millitm * 1000000;
58#endif
59
60 return rc;
61}
62
63#endif // semaphore kind defined
64

Callers 1

tryEnterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected