MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysProcessTimeGetCurrent

Function kwsysProcessTimeGetCurrent

Source/kwsys/ProcessUNIX.c:2055–2071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2053}
2054
2055static kwsysProcessTime kwsysProcessTimeGetCurrent(void)
2056{
2057 kwsysProcessTime current;
2058 kwsysProcessTimeNative current_native;
2059#if KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC
2060 struct timespec current_timespec;
2061 clock_gettime(CLOCK_MONOTONIC, &current_timespec);
2062
2063 current_native.tv_sec = current_timespec.tv_sec;
2064 current_native.tv_usec = current_timespec.tv_nsec / 1000;
2065#else
2066 gettimeofday(&current_native, 0);
2067#endif
2068 current.tv_sec = (long)current_native.tv_sec;
2069 current.tv_usec = (long)current_native.tv_usec;
2070 return current;
2071}
2072
2073#if defined(KWSYSPE_CLANG_DIAG_WSHORTEN)
2074# undef KWSYSPE_CLANG_DIAG_WSHORTEN

Callers 5

kwsysProcess_ExecuteFunction · 0.70
kwsysProcess_WaitForDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…