[gnome-shell] ShellPerfLog: Use monotonic timestamps for logging



commit f0d4260c81886c32aecd001bd1e6cb6268836dad
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Jun 5 15:08:29 2014 -0400

    ShellPerfLog: Use monotonic timestamps for logging
    
    Use g_get_monotonic_time() (that is, CLOCK_MONOTONIC) timestamps,
    rather than gettimeofday() values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732350

 src/shell-perf-log.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/shell-perf-log.c b/src/shell-perf-log.c
index 6c1f293..ab78ded 100644
--- a/src/shell-perf-log.c
+++ b/src/shell-perf-log.c
@@ -126,11 +126,7 @@ G_DEFINE_TYPE(ShellPerfLog, shell_perf_log, G_TYPE_OBJECT);
 static gint64
 get_time (void)
 {
-  GTimeVal timeval;
-
-  g_get_current_time (&timeval);
-
-  return timeval.tv_sec * G_GINT64_CONSTANT(1000000) + timeval.tv_usec;
+  return g_get_monotonic_time ();
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]