From 88f2f647e95ac1bdc372d9388887ba3ac509b9f9 Mon Sep 17 00:00:00 2001 From: "nisheeth%netscape.com" Date: Thu, 21 Oct 1999 23:27:02 +0000 Subject: [PATCH] Fixing Unix warnings. r=harishd --- modules/libutil/public/stopwatch.h | 2 -- modules/libutil/src/stopwatch.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/libutil/public/stopwatch.h b/modules/libutil/public/stopwatch.h index d8bef3a3ea9f..ce29f0ea9f16 100644 --- a/modules/libutil/public/stopwatch.h +++ b/modules/libutil/public/stopwatch.h @@ -5,8 +5,6 @@ #include "prlog.h" #include "nsDeque.h" -static double gTicks = 1.0e-7; - #ifdef XP_MAC #define R__MAC #endif diff --git a/modules/libutil/src/stopwatch.cpp b/modules/libutil/src/stopwatch.cpp index 2964ee8eb46e..fbe49f074981 100644 --- a/modules/libutil/src/stopwatch.cpp +++ b/modules/libutil/src/stopwatch.cpp @@ -9,6 +9,8 @@ #include "windows.h" #endif +double gTicks = 1.0e-7; + Stopwatch::Stopwatch() { #ifdef R__UNIX @@ -25,7 +27,7 @@ Stopwatch::Stopwatch() { Stopwatch::~Stopwatch() { EState* state = 0; if (mSavedStates) { - while (state = (EState*) mSavedStates->Pop()) { + while ((state = (EState*) mSavedStates->Pop())) { delete state; } delete mSavedStates; @@ -220,6 +222,11 @@ void Stopwatch::Print(void) { int min = int(realt / 60); realt -= min * 60; int sec = int(realt); +#ifdef MOZ_PERF_METRICS RAPTOR_STOPWATCH_TRACE(("Real time %d:%d:%d, CP time %.3f", hours, min, sec, CpuTime())); +#else + printf("Real time %d:%d:%d, CP time %.3f", hours, min, sec, CpuTime()); +#endif } +