The Nebula Device 3: Win360::Win360Timer Class Reference

The Nebula Device 3

Win360::Win360Timer Class Reference

#include <win360timer.h>

Inheritance diagram for Win360::Win360Timer:

Timing::Timer

Detailed Description

Win32/Xbox360 implementation of the Time::Timer class. Uses the QueryPerformanceCounter() functions.

Todo:
solve multiprocessor issues of QueryPerformanceCounter() (different processors may return different PerformanceFrequency values, thus, threads should be prevented from switching between processors with thread affinities).
(C) 2006 Radon Labs GmbH

Public Member Functions

 Win360Timer ()
 constructor
void Start ()
 start/continue the timer
void Stop ()
 stop the timer
void Reset ()
 reset the timer
bool Running () const
 return true if currently running
Timing::Time GetTime () const
 get current time in seconds
Timing::Tick GetTicks () const
 get current time in ticks

Member Function Documentation

void Win360::Win360Timer::Start (  ) 

start/continue the timer

Start the timer. This will update the diffTime member to reflect the accumulated time when the timer was not running (basically the difference between this timer's time and the real system time).

void Win360::Win360Timer::Stop (  ) 

stop the timer

Stop the timer. This will record the current realtime, so that the next Start() can measure the time lost between Stop() and Start() which must be taken into account to keep track of the difference between this timer's time and realtime.

void Win360::Win360Timer::Reset (  ) 

reset the timer

Reset the timer so that will start counting at zero again.

bool Win360::Win360Timer::Running (  )  const

return true if currently running

Returns true if the timer is currently running.

Timing::Time Win360::Win360Timer::GetTime (  )  const

get current time in seconds

This returns the timer's current time in seconds.

Timing::Tick Win360::Win360Timer::GetTicks (  )  const

get current time in ticks

This returns the timer's current time in "ticks". A tick is defined as one millisecond (1/1000 seconds).