mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-01 02:15:54 -04:00
52 lines
1011 B
C++
52 lines
1011 B
C++
//=================================================================== //
|
|
//
|
|
// PerformanceTimer.h
|
|
// copyright 2000-2004 Sony Online Entertainment
|
|
// All Rights Reserved
|
|
//
|
|
//===================================================================
|
|
|
|
#ifndef INCLUDED_PerformaceTimer_H
|
|
#define INCLUDED_PerformaceTimer_H
|
|
|
|
//===================================================================
|
|
|
|
#include <unistd.h>
|
|
#include <sys/time.h>
|
|
|
|
//===================================================================
|
|
|
|
class PerformanceTimer
|
|
{
|
|
public:
|
|
|
|
static void install();
|
|
|
|
public:
|
|
|
|
PerformanceTimer();
|
|
~PerformanceTimer();
|
|
|
|
void start();
|
|
void resume();
|
|
void stop();
|
|
|
|
float getElapsedTime() const;
|
|
float getSplitTime() const;
|
|
void logElapsedTime(const char* string) const;
|
|
|
|
private:
|
|
|
|
timeval startTime;
|
|
timeval stopTime;
|
|
|
|
private:
|
|
|
|
PerformanceTimer(PerformanceTimer const &);
|
|
PerformanceTimer & operator=(PerformanceTimer const &);
|
|
};
|
|
|
|
//===================================================================
|
|
|
|
#endif
|