Danbias/Code/Misc/WinTimer.h

33 lines
583 B
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////
// 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
#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