fix ctrl+g

This commit is contained in:
Eduardo Bart
2011-12-16 19:13:03 -02:00
parent d78278379b
commit a4eed64709
5 changed files with 25 additions and 13 deletions

View File

@@ -48,5 +48,20 @@ private:
extern Clock g_clock;
class Timer
{
public:
Timer() { restart(); }
void restart() { m_startTicks = g_clock.ticks(); }
ticks_t startTicks() { return m_startTicks; }
ticks_t ticksElapsed() { return g_clock.ticks() - m_startTicks; }
double timeElapsed() { return ticksElapsed()/1000.0; }
private:
ticks_t m_startTicks;
};
#endif