aboutsummaryrefslogtreecommitdiff
path: root/Source/Timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Timer.cpp')
-rw-r--r--Source/Timer.cpp26
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);
+}