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

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

#include <Timer.h>

Public Member Functions

 Timer ()
 Overloaded 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...
 
bool isTimePassed (float seconds=1.0f)
 Tests if 'seconds' seconds have passed since reset() or this method was called. More...
 
 Timer ()
 Overloaded 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...
 
bool isTimePassed (float seconds=1.0f)
 Tests if 'seconds' seconds have passed since reset() or this method was called. More...
 

Private Attributes

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

Detailed Description

Provides a platform independent high resolution timer.

Note
The timer measures real time, not CPU time.

Definition at line 33 of file Timer.h.

Constructor & Destructor Documentation

AstcTextures::Timer::Timer ( )

Overloaded default constructor.

Definition at line 28 of file Timer.cpp.

AstcTextures::Timer::Timer ( )

Overloaded default constructor.

Member Function Documentation

float AstcTextures::Timer::getTime ( )

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

Returns
Float containing the current time.

Definition at line 55 of file Timer.cpp.

float AstcTextures::Timer::getTime ( )

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

Returns
Float containing the current time.
bool AstcTextures::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 AstcTextures::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 66 of file Timer.cpp.

void AstcTextures::Timer::reset ( )

Resets the timer to 0.0f.

void AstcTextures::Timer::reset ( )

Resets the timer to 0.0f.

Definition at line 45 of file Timer.cpp.

Member Data Documentation

timeval AstcTextures::Timer::currentTime
private

Definition at line 44 of file Timer.h.

float AstcTextures::Timer::fps
private

Definition at line 38 of file Timer.h.

float AstcTextures::Timer::fpsTime
private

Definition at line 41 of file Timer.h.

int AstcTextures::Timer::frameCount
private

Definition at line 36 of file Timer.h.

float AstcTextures::Timer::lastIntervalTime
private

Definition at line 40 of file Timer.h.

float AstcTextures::Timer::lastTime
private

Definition at line 39 of file Timer.h.

timeval AstcTextures::Timer::startTime
private

Definition at line 43 of file Timer.h.


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