diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-10-26 15:21:22 +0300 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-10-26 15:21:22 +0300 |
commit | 8c0556e7cb1de8c387ddd886a03a8f8afff1fd0e (patch) | |
tree | 16c37348be0928e00aec4a5a543396a7fa0e85fa /os | |
parent | cdc8a4b7b2f099b8860a54c5c9f488e6f7c4913a (diff) | |
parent | 004d00e6689f452fc9fdf91f5ffc6d6aed697d54 (diff) |
Merge branch 'master' into input-hotplug
Diffstat (limited to 'os')
-rw-r--r-- | os/utils.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/os/utils.c b/os/utils.c index 379291c9d..7d258a444 100644 --- a/os/utils.c +++ b/os/utils.c @@ -268,8 +268,6 @@ int auditTrailLevel = 1; _X_EXPORT Bool Must_have_memory = FALSE; -static int monotonic_usable = -1; - #ifdef AIXV3 int SyncOn = 0; extern int SelectWaitTime; @@ -550,22 +548,11 @@ _X_EXPORT CARD32 GetTimeInMillis(void) { struct timeval tv; + #ifdef MONOTONIC_CLOCK struct timespec tp; - int spare = 0; - - if (_X_UNLIKELY(monotonic_usable == -1)) { - if (clock_gettime(0, &tp) == 0 && - clock_getcpuclockid(0, &spare) == 0) - monotonic_usable = 1; - else - monotonic_usable = 0; - } - - if (_X_LIKELY(monotonic_usable == 1)) { - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000); - } + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000); #endif X_GETTIMEOFDAY(&tv); |