The wall clock timer (implementing using the RTC or cycle counter on x86) is
authorChris Lattner <sabre@nondot.org>
Thu, 3 Oct 2002 21:08:20 +0000 (21:08 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 3 Oct 2002 21:08:20 +0000 (21:08 +0000)
so much more accurate than the per process timers that we get better results
(less noise) by sorting according to wall time than process time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4034 91177308-0d34-0410-b5e6-96231b3b80d8

include/Support/Timer.h
include/llvm/Support/Timer.h

index 93d9d166093541737ab76e49dbf0009cbbd120fa..5d39fc0f12eee33f53370d0d7e928a8fe669ba35 100644 (file)
@@ -64,13 +64,7 @@ public:
 
   // operator< - Allow sorting...
   bool operator<(const Timer &T) const {
-    // Primary sort key is User+System time
-    if (UserTime+SystemTime < T.UserTime+T.SystemTime)
-      return true;
-    if (UserTime+SystemTime > T.UserTime+T.SystemTime)
-      return false;
-    
-    // Secondary sort key is Wall Time
+    // Sort by Wall Time elapsed, as it is the only thing really accurate
     return Elapsed < T.Elapsed;
   }
   bool operator>(const Timer &T) const { return T.operator<(*this); }
index 93d9d166093541737ab76e49dbf0009cbbd120fa..5d39fc0f12eee33f53370d0d7e928a8fe669ba35 100644 (file)
@@ -64,13 +64,7 @@ public:
 
   // operator< - Allow sorting...
   bool operator<(const Timer &T) const {
-    // Primary sort key is User+System time
-    if (UserTime+SystemTime < T.UserTime+T.SystemTime)
-      return true;
-    if (UserTime+SystemTime > T.UserTime+T.SystemTime)
-      return false;
-    
-    // Secondary sort key is Wall Time
+    // Sort by Wall Time elapsed, as it is the only thing really accurate
     return Elapsed < T.Elapsed;
   }
   bool operator>(const Timer &T) const { return T.operator<(*this); }