OGRE: Ogre::Timer Class Reference - OGRE Documentation

# Ogre::Timer Class Reference

Timer class. More...

`#include <OgreTimerImp.h>`

Inheritance diagram for Ogre::Timer:

[legend]

List of all members.

## Public Member Functions
| Timer ()
| ~Timer ()
bool | setOption (const String &strKey, const void *pValue)
| Method for setting a specific option of the Timer.
void | reset ()
| Resets timer.
unsigned long | getMilliseconds ()
| Returns milliseconds since initialisation or last reset.
unsigned long | getMicroseconds ()
| Returns microseconds since initialisation or last reset.
unsigned long | getMillisecondsCPU ()
| Returns milliseconds since initialisation or last reset, only CPU time measured.
unsigned long | getMicrosecondsCPU ()
| Returns microseconds since initialisation or last reset, only CPU time measured.
| Timer ()
| ~Timer ()
bool | setOption (const String &strKey, const void *pValue)
| Method for setting a specific option of the Timer.
void | reset ()
| Resets timer.
unsigned long | getMilliseconds ()
| Returns milliseconds since initialisation or last reset.
unsigned long | getMicroseconds ()
| Returns microseconds since initialisation or last reset.
unsigned long | getMillisecondsCPU ()
| Returns milliseconds since initialisation or last reset, only CPU time measured.
unsigned long | getMicrosecondsCPU ()
| Returns microseconds since initialisation or last reset, only CPU time measured.
| Timer ()
| Timer constructor.
| ~Timer ()
bool | setOption (const String &strKey, const void *pValue)
| Method for setting a specific option of the Timer.
void | reset ()
| Resets timer.
unsigned long | getMilliseconds ()
| Returns milliseconds since initialisation or last reset.
unsigned long | getMicroseconds ()
| Returns microseconds since initialisation or last reset.
unsigned long | getMillisecondsCPU ()
| Returns milliseconds since initialisation or last reset, only CPU time measured.
unsigned long | getMicrosecondsCPU ()
| Returns microseconds since initialisation or last reset, only CPU time measured.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
## Private Attributes
struct timeval | start
clock_t | zeroClock
clock_t | mZeroClock
DWORD | mStartTick
LONGLONG | mLastTime
LARGE_INTEGER | mStartTime
LARGE_INTEGER | mFrequency
DWORD | mTimerMask

## Detailed Description

Timer class.

Definition at line 38 of file GLX/OgreTimerImp.h.

## Constructor & Destructor Documentation

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

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

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

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

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

Timer constructor.

MUST be called on same thread that calls getMilliseconds()

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

## Member Function Documentation

bool Ogre::Timer::setOption | ( | const String & | strKey,
|  | const void * | pValue |
| ) |  |  |

Method for setting a specific option of the Timer.

These options are usually specific for a certain implementation of the Timer class, and may (and probably will) not exist across different implementations. reset() must be called after all setOption() calls.

Parameters:

  | strKey | The name of the option to set
  | pValue | A pointer to the value - the size should be calculated by the timer based on the key

Returns:
  On success, true is returned.

  On failure, false is returned.

Definition at line 61 of file GLX/OgreTimerImp.h.

void Ogre::Timer::reset | ( |  | ) |

Resets timer.

unsigned long Ogre::Timer::getMilliseconds | ( |  | ) |

Returns milliseconds since initialisation or last reset.

unsigned long Ogre::Timer::getMicroseconds | ( |  | ) |

Returns microseconds since initialisation or last reset.

unsigned long Ogre::Timer::getMillisecondsCPU | ( |  | ) |

Returns milliseconds since initialisation or last reset, only CPU time measured.

unsigned long Ogre::Timer::getMicrosecondsCPU | ( |  | ) |

Returns microseconds since initialisation or last reset, only CPU time measured.

bool Ogre::Timer::setOption | ( | const String & | strKey,
|  | const void * | pValue |
| ) |  |  |

Method for setting a specific option of the Timer.

These options are usually specific for a certain implementation of the Timer class, and may (and probably will) not exist across different implementations. reset() must be called after all setOption() calls.

Parameters:

  | strKey | The name of the option to set
  | pValue | A pointer to the value - the size should be calculated by the timer based on the key

Returns:
  On success, true is returned.

  On failure, false is returned.

Definition at line 61 of file OSX/OgreTimerImp.h.

void Ogre::Timer::reset | ( |  | ) |

Resets timer.

unsigned long Ogre::Timer::getMilliseconds | ( |  | ) |

Returns milliseconds since initialisation or last reset.

unsigned long Ogre::Timer::getMicroseconds | ( |  | ) |

Returns microseconds since initialisation or last reset.

unsigned long Ogre::Timer::getMillisecondsCPU | ( |  | ) |

Returns milliseconds since initialisation or last reset, only CPU time measured.

unsigned long Ogre::Timer::getMicrosecondsCPU | ( |  | ) |

Returns microseconds since initialisation or last reset, only CPU time measured.

bool Ogre::Timer::setOption | ( | const String & | strKey,
|  | const void * | pValue |
| ) |  |  |

Method for setting a specific option of the Timer.

These options are usually specific for a certain implementation of the Timer class, and may (and probably will) not exist across different implementations. reset() must be called after all setOption() calls.

  Current options supported are:
  - "QueryAffinityMask" (DWORD): Set the thread affinity mask to be used to check the timer. If 'reset' has been called already this mask should overlap with the process mask that was in force at that point, and should be a power of two (a single core).

Parameters:

  | strKey | The name of the option to set
  | pValue | A pointer to the value - the size should be calculated by the timer based on the key

Returns:
  On success, true is returned.

  On failure, false is returned.

void Ogre::Timer::reset | ( |  | ) |

Resets timer.

unsigned long Ogre::Timer::getMilliseconds | ( |  | ) |

Returns milliseconds since initialisation or last reset.

unsigned long Ogre::Timer::getMicroseconds | ( |  | ) |

Returns microseconds since initialisation or last reset.

unsigned long Ogre::Timer::getMillisecondsCPU | ( |  | ) |

Returns milliseconds since initialisation or last reset, only CPU time measured.

unsigned long Ogre::Timer::getMicrosecondsCPU | ( |  | ) |

Returns microseconds since initialisation or last reset, only CPU time measured.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 62 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 84 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 89 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 106 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

## Member Data Documentation

struct timeval Ogre::Timer::start`[read, private]`

Definition at line 41 of file GLX/OgreTimerImp.h.

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

Definition at line 42 of file GLX/OgreTimerImp.h.

clock_t Ogre::Timer::mZeroClock`[private]`

Definition at line 41 of file WIN32/OgreTimerImp.h.

DWORD Ogre::Timer::mStartTick`[private]`

Definition at line 43 of file WIN32/OgreTimerImp.h.

LONGLONG Ogre::Timer::mLastTime`[private]`

Definition at line 44 of file WIN32/OgreTimerImp.h.

LARGE_INTEGER Ogre::Timer::mStartTime`[private]`

Definition at line 45 of file WIN32/OgreTimerImp.h.

LARGE_INTEGER Ogre::Timer::mFrequency`[private]`

Definition at line 46 of file WIN32/OgreTimerImp.h.

DWORD Ogre::Timer::mTimerMask`[private]`

Definition at line 48 of file WIN32/OgreTimerImp.h.

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

- GLX/OgreTimerImp.h
- OSX/OgreTimerImp.h
- WIN32/OgreTimerImp.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:32:43 2009