summary refs log tree commit diff
path: root/src/Timer.cpp
blob: 80cc5f9c612ae5523c979e2a496acda74ab4978a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}