diff options
author | Brad King <brad.king@kitware.com> | 2017-10-13 13:14:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-13 13:14:04 (GMT) |
commit | df92617b7323978c0a8d589fd6b41fcc2c67613e (patch) | |
tree | 58c04ca80c87759109832df1ab7e50a631aeceaa /Source/kwsys/ProcessUNIX.c | |
parent | 18eec1153956c946ce48b33c3890e8862cdbd06c (diff) | |
parent | e44b0cb2f0d6d0065faabd510efdcfc6359a8025 (diff) | |
download | CMake-df92617b7323978c0a8d589fd6b41fcc2c67613e.zip CMake-df92617b7323978c0a8d589fd6b41fcc2c67613e.tar.gz CMake-df92617b7323978c0a8d589fd6b41fcc2c67613e.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2017-10-12 (ef0ad34d)
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 1431f30..e62ef34 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -2026,7 +2026,15 @@ static kwsysProcessTime kwsysProcessTimeGetCurrent(void) { kwsysProcessTime current; kwsysProcessTimeNative current_native; +#if KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC + struct timespec current_timespec; + clock_gettime(CLOCK_MONOTONIC, ¤t_timespec); + + current_native.tv_sec = current_timespec.tv_sec; + current_native.tv_usec = current_timespec.tv_nsec / 1000; +#else gettimeofday(¤t_native, 0); +#endif current.tv_sec = (long)current_native.tv_sec; current.tv_usec = (long)current_native.tv_usec; return current; |