2013-11-06 22:52:00 +01:00
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Instanciable Timer class for windows
|
|
|
|
|
// <20> Dan Andersson 2013
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#ifndef WINTIMER_H
|
|
|
|
|
#define WINTIMER_H
|
|
|
|
|
|
2014-01-29 10:18:01 +01:00
|
|
|
|
#define NOMINMAX
|
2013-11-06 22:52:00 +01:00
|
|
|
|
#include <Windows.h>
|
|
|
|
|
|
|
|
|
|
namespace Utility
|
|
|
|
|
{
|
|
|
|
|
class WinTimer
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
WinTimer( );
|
|
|
|
|
|
|
|
|
|
void reset( );
|
|
|
|
|
void pause( );
|
|
|
|
|
void resume( );
|
|
|
|
|
|
|
|
|
|
double getElapsedSeconds( ) const;
|
|
|
|
|
LARGE_INTEGER getCurrentTick( ) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
LARGE_INTEGER startTick, pauseStart, pauseCount;
|
|
|
|
|
bool isPaused;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|