Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# Ogre::Timer Class Reference

Platform-independent Timer class. More...

`#include <OgreTimer.h>`

Inheritance diagram for Ogre::Timer:

[legend]
List of all members.

## Public Methods

| Timer ()
| Creates a timer.
virtual void | reset ()
| Resets timer.
virtual unsigned long | getMilliseconds ()
| Returns milliseconds since initialisation or last reset.
virtual unsigned long | getMillisecondsCPU ()
| Returns milliseconds since initialisation or last reset, only CPU time measured.
virtual unsigned long | getMicroseconds ()
| Returns microseconds since initialisation or last reset.
virtual unsigned long | getMicrosecondsCPU ()
| Returns microseconds since initialisation or last reset, only CPU time measured.

## Protected Attributes

clock_t | zeroClock

## Detailed Description

Platform-independent Timer class.

Remarks:
  You should never create a Timer instance manually; instead, use PlatformManager::createTimer.

Definition at line 36 of file OgreTimer.h.

## Constructor & Destructor Documentation

Ogre::Timer::Timer | ( |  | ) |

Creates a timer.

Remarks:
  You must call reset() after creating it; the constructor cannot do it because the call would not be polymorphic.

Definition at line 30 of file OgreTimer.cpp.

## Member Function Documentation

unsigned long Ogre::Timer::getMicroseconds | ( |  | ) | `[virtual]`

| Returns microseconds since initialisation or last reset. Reimplemented in Ogre::GLXTimer, Ogre::SDLTimer, and Ogre::Win32Timer. Definition at line 52 of file OgreTimer.cpp. References getMicrosecondsCPU(). Referenced by Ogre::Profiler::beginProfile(), and Ogre::Profiler::endProfile().

unsigned long Ogre::Timer::getMicrosecondsCPU | ( |  | ) | `[virtual]`

| Returns microseconds since initialisation or last reset, only CPU time measured. Definition at line 57 of file OgreTimer.cpp. References zeroClock. Referenced by getMicroseconds().

unsigned long Ogre::Timer::getMilliseconds | ( |  | ) | `[virtual]`

Returns milliseconds since initialisation or last reset.

Reimplemented in Ogre::GLXTimer, Ogre::SDLTimer, and Ogre::Win32Timer.

Definition at line 41 of file OgreTimer.cpp.

References getMillisecondsCPU().

Referenced by Ogre::Root::_fireFrameEnded(), Ogre::Root::_fireFrameStarted(), Ogre::RenderTarget::resetStatistics(), Ogre::RenderTarget::updateStats(), and Ogre::RenderTarget::writeContentsToTimestampedFile().

unsigned long Ogre::Timer::getMillisecondsCPU | ( |  | ) | `[virtual]`

| Returns milliseconds since initialisation or last reset, only CPU time measured. Definition at line 46 of file OgreTimer.cpp. References zeroClock. Referenced by getMilliseconds().

void Ogre::Timer::reset | ( |  | ) | `[virtual]`

| Resets timer. Reimplemented in Ogre::GLXTimer, Ogre::SDLTimer, and Ogre::Win32Timer. Definition at line 36 of file OgreTimer.cpp. References zeroClock. Referenced by Ogre::Root::initialise().

## Member Data Documentation

clock_t Ogre::Timer::zeroClock`[protected]`

| Definition at line 39 of file OgreTimer.h. Referenced by getMicrosecondsCPU(), getMillisecondsCPU(), and reset().

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

- OgreTimer.h
- OgreTimer.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:46 2004