summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Timer.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-03 21:08:20 +0000
committerChris Lattner <sabre@nondot.org>2002-10-03 21:08:20 +0000
commitb0d0f5b473b6110a9e72d823f2f2c4c52928a1bf (patch)
tree158d10cc8a352b0ed3ed92f76125273980d72fa2 /include/llvm/Support/Timer.h
parent62d928eac166a1db5e9cbfcb0b75f1c41c68f66a (diff)
downloadllvm-b0d0f5b473b6110a9e72d823f2f2c4c52928a1bf.tar.gz
llvm-b0d0f5b473b6110a9e72d823f2f2c4c52928a1bf.tar.bz2
llvm-b0d0f5b473b6110a9e72d823f2f2c4c52928a1bf.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Timer.h')
-rw-r--r--include/llvm/Support/Timer.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h
index 93d9d16609..5d39fc0f12 100644
--- a/include/llvm/Support/Timer.h
+++ b/include/llvm/Support/Timer.h
@@ -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); }