Skip to content

Commit e0cfbb7

Browse files
committed
Output GC time only when requested
- remove double output of GC time Signed-off-by: Stefan Marr <git@stefan-marr.de>
1 parent a934e9a commit e0cfbb7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/vm/Print.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ __attribute__((noreturn)) __attribute__((noinline)) void ErrorExit(
4141
}
4242

4343
__attribute__((noreturn)) __attribute__((noinline)) void Quit(int32_t err) {
44-
ErrorPrint("Time spent in GC: [" +
45-
to_string(Timer::GCTimer.GetTotalTime()) + "] msec\n");
46-
4744
Universe::Shutdown();
4845

4946
OutputAllocationLogFile();

src/vm/Universe.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ void Universe::BasicInit() {
9393
}
9494

9595
void Universe::Shutdown() {
96-
ErrorPrint("Time spent in GC: [" +
97-
to_string(Timer::GCTimer.GetTotalTime()) + "] msec\n");
96+
if (gcVerbosity > 0) {
97+
ErrorPrint("Time spent in GC: [" +
98+
to_string(Timer::GCTimer.GetTotalTime()) + "] msec\n");
99+
}
100+
98101
#ifdef GENERATE_INTEGER_HISTOGRAM
99102
std::string file_name_hist = std::string(bm_name);
100103
file_name_hist.append("_integer_histogram.csv");

0 commit comments

Comments
 (0)