Mali OpenGL ES SDK  2.0.0
A simple framework to aid development of OpenGL ES applications targeting ARM Mali platforms.
 All Classes Files Functions Variables Enumerations Enumerator
MaliSDK::Timer Class Reference

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

#include <Timer.h>

List of all members.

Public Member Functions

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

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.

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.
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.
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.

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