[PATCH xserver 1/4] os: Always return microseconds from GetTimeInMicros()

Jeff Smith whydoubt at gmail.com
Wed Dec 27 04:10:52 UTC 2017


When a monotonic clock is not available, GetTimeInMicros() returns the
time in nanoseconds.  Instead, return the time in microseconds, as the
name indicates.

Signed-off-by: Jeff Smith <whydoubt at gmail.com>
---
 os/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os/utils.c b/os/utils.c
index 8a758f0..4a8d124 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -497,7 +497,7 @@ GetTimeInMicros(void)
 #endif
 
     X_GETTIMEOFDAY(&tv);
-    return (CARD64) tv.tv_sec * (CARD64)1000000000 + (CARD64) tv.tv_usec * 1000;
+    return (CARD64) tv.tv_sec * (CARD64)1000000 + (CARD64) tv.tv_usec;
 }
 #endif
 
-- 
2.9.4



More information about the xorg-devel mailing list