summary refs log tree commit diff
path: root/src/Timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Timer.cpp')
-rw-r--r--src/Timer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Timer.cpp b/src/Timer.cpp
new file mode 100644
index 0000000..80cc5f9
--- /dev/null
+++ b/src/Timer.cpp
@@ -0,0 +1,28 @@
+/**> HEADER FILES <**/
+#include <string.h>
+#include "Timer.h"				
+#include "Support.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);
+}