OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaliSDK::Timer Class Reference

Provides a platform independent high resolution timer. More...

#include <Timer.h>

Public Member Functions

 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
float getInterval ()
 Returns the time passed since getInterval() was last called. More...
 
float getFPS ()
 Returns the FPS (Frames Per Second). More...
 
bool isTimePassed (float seconds=1.0f)
 Tests if 'seconds' seconds have passed since reset() or this method was called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
float getInterval ()
 Returns the time passed since getInterval() was last called. More...
 
float getFPS ()
 Returns the FPS (Frames Per Second). More...
 
bool isTimePassed (float seconds=1.0f)
 Tests if 'seconds' seconds have passed since reset() or this method was called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 
 Timer ()
 Default Constructor. More...
 
void reset ()
 Resets the timer to 0.0f. More...
 
float getTime ()
 Returns the time passed since object creation or since reset() was last called. More...
 

Private Attributes

int frameCount
 
float fps
 
float lastTime
 
timeval startTime
 
timeval currentTime
 
float lastIntervalTime
 
float fpsTime
 

Detailed Description

Provides a platform independent high resolution timer.

Note
The timer measures real time, not CPU time.

Definition at line 37 of file Timer.h.

Constructor & Destructor Documentation

MaliSDK::Timer::Timer ( )

Default Constructor.

Definition at line 84 of file Timer.cpp.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

MaliSDK::Timer::Timer ( )

Default Constructor.

Member Function Documentation

float MaliSDK::Timer::getFPS ( )

Returns the FPS (Frames Per Second).

This function must be called once per frame.

Returns
Float containing the current FPS.

Definition at line 125 of file Timer.cpp.

float MaliSDK::Timer::getFPS ( )

Returns the FPS (Frames Per Second).

This function must be called once per frame.

Returns
Float containing the current FPS.
float MaliSDK::Timer::getInterval ( )

Returns the time passed since getInterval() was last called.

If getInterval() has not been called before, it retrieves the time passed since object creation or since reset() was called.

Returns
Float containing the interval.

Definition at line 117 of file Timer.cpp.

float MaliSDK::Timer::getInterval ( )

Returns the time passed since getInterval() was last called.

If getInterval() has not been called before, it retrieves the time passed since object creation or since reset() was called.

Returns
Float containing the interval.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.

Definition at line 109 of file Timer.cpp.

float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
float MaliSDK::Timer::getTime ( )

Returns the time passed since object creation or since reset() was last called.

Returns
Float containing the current time.
bool MaliSDK::Timer::isTimePassed ( float  seconds = 1.0f)

Tests if 'seconds' seconds have passed since reset() or this method was called.

Parameters
[in]secondsnumber of seconds passed default is 1.0
Returns
bool true if a 'seconds' seconds are passed and false otherwise.
bool MaliSDK::Timer::isTimePassed ( float  seconds = 1.0f)

Tests if 'seconds' seconds have passed since reset() or this method was called.

Parameters
[in]secondsnumber of seconds passed default is 1.0
Returns
bool true if a 'seconds' seconds are passed and false otherwise.

Definition at line 141 of file Timer.cpp.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

Definition at line 100 of file Timer.cpp.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

void MaliSDK::Timer::reset ( )

Resets the timer to 0.0f.

Member Data Documentation

timeval MaliSDK::Timer::currentTime
private

Definition at line 50 of file Timer.h.

float MaliSDK::Timer::fps
private

Definition at line 41 of file Timer.h.

float MaliSDK::Timer::fpsTime
private

Definition at line 52 of file Timer.h.

int MaliSDK::Timer::frameCount
private

Definition at line 40 of file Timer.h.

float MaliSDK::Timer::lastIntervalTime
private

Definition at line 51 of file Timer.h.

float MaliSDK::Timer::lastTime
private

Definition at line 42 of file Timer.h.

timeval MaliSDK::Timer::startTime
private

Definition at line 49 of file Timer.h.


The documentation for this class was generated from the following files: