summaryrefslogtreecommitdiff
path: root/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-02-09 18:41:32 +0000
committerChris Lattner <sabre@nondot.org>2005-02-09 18:41:32 +0000
commit3ac960510970df4831ff511e69c9de5c6030fe3b (patch)
tree55484923472746654dc8c9d9f5a5b42b9e17deb9 /lib/Support/Timer.cpp
parentfe0343a1cdb6f77efa5df24b22626b92d3871d39 (diff)
downloadllvm-3ac960510970df4831ff511e69c9de5c6030fe3b.tar.gz
llvm-3ac960510970df4831ff511e69c9de5c6030fe3b.tar.bz2
llvm-3ac960510970df4831ff511e69c9de5c6030fe3b.tar.xz
Don't print a 'Total Execution Time' line for the 'Miscellaneous Ungrouped
Timers' section. Since these are random timers in the program it doesn't make sense to sum them up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Timer.cpp')
-rw-r--r--lib/Support/Timer.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp
index 3713f7f69c..382825a2a4 100644
--- a/lib/Support/Timer.cpp
+++ b/lib/Support/Timer.cpp
@@ -302,12 +302,20 @@ void TimerGroup::removeTimer() {
*OutStream << "===" << std::string(73, '-') << "===\n"
<< std::string(Padding, ' ') << Name << "\n"
<< "===" << std::string(73, '-')
- << "===\n Total Execution Time: ";
-
- printAlignedFP(Total.getProcessTime(), 4, 5, *OutStream);
- *OutStream << " seconds (";
- printAlignedFP(Total.getWallTime(), 4, 5, *OutStream);
- *OutStream << " wall clock)\n\n";
+ << "===\n";
+
+ // If this is not an collection of ungrouped times, print the total time.
+ // Ungrouped timers don't really make sense to add up. We still print the
+ // TOTAL line to make the percentages make sense.
+ if (this != DefaultTimerGroup) {
+ *OutStream << " Total Execution Time: ";
+
+ printAlignedFP(Total.getProcessTime(), 4, 5, *OutStream);
+ *OutStream << " seconds (";
+ printAlignedFP(Total.getWallTime(), 4, 5, *OutStream);
+ *OutStream << " wall clock)\n";
+ }
+ *OutStream << "\n";
if (Total.UserTime)
*OutStream << " ---User Time---";