[llvm-commits] CVS: llvm/include/Support/Timer.h

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 3 16:09:01 PDT 2002


Changes in directory llvm/include/Support:

Timer.h updated: 1.1 -> 1.2

---
Log message:

The wall clock timer (implementing using the RTC or cycle counter on x86) is 
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.



---
Diffs of the changes:

Index: llvm/include/Support/Timer.h
diff -u llvm/include/Support/Timer.h:1.1 llvm/include/Support/Timer.h:1.2
--- llvm/include/Support/Timer.h:1.1	Tue Oct  1 14:36:51 2002
+++ llvm/include/Support/Timer.h	Thu Oct  3 16:08:20 2002
@@ -64,13 +64,7 @@
 
   // 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); }





More information about the llvm-commits mailing list