diff options
| author | icculus <icculus@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-02 21:06:00 +0000 |
|---|---|---|
| committer | icculus <icculus@5198baeb-e213-0410-be47-fc2ff85ca46f> | 2003-01-02 21:06:00 +0000 |
| commit | e17acec1c9bec3a26d97ca2873bb77bdcb48665e (patch) | |
| tree | 26b14b6cedcb70df651c23dddbf0981970d0bd4d /Source/Timer.cpp | |
| parent | 59ca62d601e30b5467f8ecd2cb7d517bc682fc12 (diff) | |
| download | blackshades-e17acec1c9bec3a26d97ca2873bb77bdcb48665e.tar.gz | |
Initial revision
git-svn-id: svn://svn.icculus.org/blackshades/trunk@2 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source/Timer.cpp')
| -rw-r--r-- | Source/Timer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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 <string.h> + +/********************> 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); +} |
