
Untitled
By: a guest on
Aug 9th, 2012 | syntax:
C++ | size: 0.36 KB | hits: 17 | expires: Never
#pragma once
#include <MMSystem.h>
#pragma comment(lib, "winmm.lib")
class SimpleTimer
{
UINT startcycles;
public:
UINT m_overhead;
SimpleTimer(void)
{
m_overhead=0;
Start();
m_overhead = Stop();
}
void Start()
{
startcycles = timeGetTime();
}
UINT Stop()
{
return timeGetTime()-startcycles-m_overhead;
}
};