зеркало из https://github.com/mozilla/pjs.git
Fixed warnings. Enabled code to build on UNIX. r=pollmann
This commit is contained in:
Родитель
57ef3f72f1
Коммит
1725d06c16
|
@ -5,12 +5,16 @@
|
|||
#include "prlog.h"
|
||||
#include "nsDeque.h"
|
||||
|
||||
const double gTicks = 1.0e-7;
|
||||
static double gTicks = 1.0e-7;
|
||||
|
||||
#ifdef XP_MAC
|
||||
#define R__MAC
|
||||
#endif
|
||||
|
||||
#ifdef XP_UNIX
|
||||
#define R__UNIX
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PERF_METRICS
|
||||
# define NS_RESET_AND_START_STOPWATCH(_sw) \
|
||||
_sw.Start(PR_TRUE);
|
||||
|
@ -94,8 +98,8 @@ public:
|
|||
void RestoreState(); // restore last recored state of stopwatch
|
||||
double RealTime();
|
||||
void Reset() { ResetCpuTime(); ResetRealTime(); }
|
||||
void ResetCpuTime(double time = 0) { Stop(); fTotalCpuTime = time; }
|
||||
void ResetRealTime(double time = 0) { Stop(); fTotalRealTime = time; }
|
||||
void ResetCpuTime(double aTime = 0) { Stop(); fTotalCpuTime = aTime; }
|
||||
void ResetRealTime(double aTime = 0) { Stop(); fTotalRealTime = aTime; }
|
||||
double CpuTime();
|
||||
void Print(void);
|
||||
static double GetRealTime();
|
||||
|
|
|
@ -28,6 +28,7 @@ LIBRARY_NAME = mozutil_s
|
|||
REQUIRES = util
|
||||
|
||||
CSRCS = obs.c
|
||||
CPPSRCS = stopwatch.cpp
|
||||
|
||||
INHIBIT_STRIP_NOT_EXPORTED = 1
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#include "stopwatch.h"
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#ifdef XP_UNIX
|
||||
#include <unistd.h>
|
||||
#include <sys/times.h>
|
||||
#endif
|
||||
#ifdef XP_WIN
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
@ -79,7 +83,7 @@ void Stopwatch::RestoreState() {
|
|||
state = (EState*) mSavedStates->Pop();
|
||||
if (state) {
|
||||
if (*state == kRunning && fState == kStopped)
|
||||
Start(FALSE);
|
||||
Start(PR_FALSE);
|
||||
else if (*state == kStopped && fState == kRunning)
|
||||
Stop();
|
||||
delete state;
|
||||
|
|
Загрузка…
Ссылка в новой задаче