Skip to content
Snippets Groups Projects
Commit 749b7506 authored by Wouter Klouwen's avatar Wouter Klouwen
Browse files

ProcessUNIX: Use monotonic clock in kwsysProcessTimeGetCurrent() for POSIX

While a process is running, it is possible for other processes such as
NTP to alter the system clock in large jumps.

To make the measurement of how long a process has taken to run
impervious to such large jumps it is helpful to use a monotonic clock.
This is a clock that takes an arbitrary starting point that does not
change.

clock_gettime() is a POSIX method that implements this clock. This is
not available on all platforms, so this commit adds a check for its
presence. If the monotonic timer is available, use that in
kwsysProcessTimeGetCurrent(), otherwise falls back to previous
non-monotonic behaviour.
parent 239bc737
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment