2007-01-26 19:36:29 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2007, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _STOP_WATCH_H
|
|
|
|
#define _STOP_WATCH_H
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#include <BeBuild.h>
|
2003-05-14 21:21:46 +04:00
|
|
|
#include <SupportDefs.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
class BStopWatch {
|
2007-01-26 19:36:29 +03:00
|
|
|
public:
|
|
|
|
BStopWatch(const char* name, bool silent = false);
|
|
|
|
virtual ~BStopWatch();
|
|
|
|
|
|
|
|
void Suspend();
|
|
|
|
void Resume();
|
|
|
|
bigtime_t Lap();
|
|
|
|
bigtime_t ElapsedTime() const;
|
|
|
|
void Reset();
|
|
|
|
const char* Name() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void _ReservedStopWatch1();
|
|
|
|
virtual void _ReservedStopWatch2();
|
|
|
|
|
|
|
|
bigtime_t fStart;
|
|
|
|
bigtime_t fSuspendTime;
|
|
|
|
bigtime_t fLaps[10];
|
|
|
|
int32 fLap;
|
|
|
|
const char* fName;
|
|
|
|
uint32 _reserved[2];
|
|
|
|
bool fSilent;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
2007-01-26 19:36:29 +03:00
|
|
|
#endif // _STOP_WATCH_H
|