From e17acec1c9bec3a26d97ca2873bb77bdcb48665e Mon Sep 17 00:00:00 2001 From: icculus Date: Thu, 2 Jan 2003 21:06:00 +0000 Subject: Initial revision git-svn-id: svn://svn.icculus.org/blackshades/trunk@2 5198baeb-e213-0410-be47-fc2ff85ca46f --- Source/Timer.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Source/Timer.cpp (limited to 'Source/Timer.cpp') diff --git a/Source/Timer.cpp b/Source/Timer.cpp new file mode 100644 index 0000000..5360e5f --- /dev/null +++ b/Source/Timer.cpp @@ -0,0 +1,26 @@ +/**> HEADER FILES <**/ +#include "Timer.h" +#include + +/********************> Timer <*****/ +void TimerInit(timer* theTimer) +{ + UnsignedWide ms; + + Microseconds(&ms); + + memset(theTimer, 0, sizeof(timer)); + + theTimer->mm_timer_start = ms.lo; + theTimer->mm_timer_elapsed = theTimer->mm_timer_start; +} + +float TimerGetTime(timer* theTimer) +{ + UnsignedWide ms; + + Microseconds(&ms); + + + return( (float) (ms.lo - theTimer->mm_timer_start) * 1000.0f); +} -- cgit v1.2.3