Skip to content
Snippets Groups Projects
Forked from Utils / KWSys
633 commits behind the upstream repository.
Wouter Klouwen's avatar
Wouter Klouwen authored
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.
749b7506
History

KWSys

Introduction

KWSys is the Kitware System Library. It provides platform-independent APIs to many common system features that are implemented differently on every platform. This library is intended to be shared among many projects at the source level, so it has a configurable namespace. Each project should configure KWSys to use a namespace unique to itself. See comments in CMakeLists.txt for details.

License

KWSys is distributed under the OSI-approved BSD 3-clause License. See Copyright.txt for details.

Reporting Bugs

KWSys has no independent issue tracker. After encountering an issue (bug) please submit a patch using the instructions for Contributing. Otherwise please report the issue to the tracker for the project that hosts the copy of KWSys in which the problem was found.

Contributing

See CONTRIBUTING.rst for instructions to contribute.