# FoundationClasses
TKernel
OSD

# OSD_Timer Class Reference

Working on heterogeneous platforms
we need to use the system call gettimeofday.
This function is portable and it measures ELAPSED
time and CPU time in seconds and microseconds.
Example: OSD_Timer aTimer;
aTimer.Start(); // Start the timers (t1).
..... // Do something.
aTimer.Stop(); // Stop the timers (t2).
aTimer.Show(); // Give the elapsed time between t1 and t2.
// Give also the process CPU time between
// t1 and t2.
.

`#include <OSD_Timer.hxx>`

Inheritance diagram for OSD_Timer:

[legend]

## Public Member Functions

void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
Standard_EXPORT | OSD_Timer ()
| Builds a Chronometer initialized and stopped. .
virtual Standard_EXPORT void | Destroy ()
virtual Standard_EXPORT | ~OSD_Timer ()
virtual Standard_EXPORT void | Reset ()
| Stops and reinitializes the timer. .
virtual Standard_EXPORT void | Show ()
| Shows both the elapsed time and CPU time on the standard output stream <cout>.The chronometer can be running (Lap Time) or stopped. .
virtual Standard_EXPORT void | Show (Standard_OStream &os)
| Shows both the elapsed time and CPU time on the output stream <os>. .
Standard_EXPORT void | Show (Standard_Real &seconds, Standard_Integer &minutes, Standard_Integer &hours, Standard_Real &CPUtime)
| returns both the elapsed time(seconds,minutes,hours) and CPU time.
virtual Standard_EXPORT void | Stop ()
| Stops the Timer. .
virtual Standard_EXPORT void | Start ()
| Starts (after Create or Reset) or restarts (after Stop) the Timer. .

## Private Attributes

Standard_Integer | TimeCumulInt
Standard_Integer | MicroCumulInt
Standard_Real | TimeCumul
Standard_Real | MicroCumul
Standard_Address | RefToInitialTimeB
Standard_Address | RefToCurrentTimeB

## Constructor & Destructor Documentation

Standard_EXPORT OSD_Timer::OSD_Timer | ( |  | ) |

virtual Standard_EXPORT OSD_Timer::~OSD_Timer | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual Standard_EXPORT void OSD_Timer::Destroy | ( |  | ) | `[virtual]`

| Reimplemented from OSD_Chronometer.

void OSD_Timer::operator delete | ( | void * | anAddress | ) | `[inline]`

| Reimplemented from OSD_Chronometer.

void* OSD_Timer::operator new | ( | size_t | size | ) | `[inline]`

| Reimplemented from OSD_Chronometer.

void* OSD_Timer::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

| Reimplemented from OSD_Chronometer.

virtual Standard_EXPORT void OSD_Timer::Reset | ( |  | ) | `[virtual]`

| Reimplemented from OSD_Chronometer.

Standard_EXPORT void OSD_Timer::Show | ( | Standard_Real & | seconds,
|  | Standard_Integer & | minutes,
|  | Standard_Integer & | hours,
|  | Standard_Real & | CPUtime
| ) |

virtual Standard_EXPORT void OSD_Timer::Show | ( | Standard_OStream & | os | ) | `[virtual]`

| Reimplemented from OSD_Chronometer.

virtual Standard_EXPORT void OSD_Timer::Show | ( |  | ) | `[virtual]`

| Reimplemented from OSD_Chronometer.

virtual Standard_EXPORT void OSD_Timer::Start | ( |  | ) | `[virtual]`

| Reimplemented from OSD_Chronometer.

virtual Standard_EXPORT void OSD_Timer::Stop | ( |  | ) | `[virtual]`

| Reimplemented from OSD_Chronometer.

## Field Documentation

Standard_Real OSD_Timer::MicroCumul `[private]`

Standard_Integer OSD_Timer::MicroCumulInt `[private]`

Standard_Address OSD_Timer::RefToCurrentTimeB `[private]`

Standard_Address OSD_Timer::RefToInitialTimeB `[private]`

Standard_Real OSD_Timer::TimeCumul `[private]`

Standard_Integer OSD_Timer::TimeCumulInt `[private]`

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

- OSD_Timer.hxx