summary refs log tree commit diff
path: root/src/Timer.cpp
blob: 869c15416c1b14f5dc17b0a5e9ac5b01decf04ab (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
/**> 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);
}