H::UtilTime Class Reference

Main UtilTime class. More...

#include <UtilTime.hpp>

List of all members.

Public Member Functions

unsigned long getElapsedTime ()
 get the elapsed time
void updateElapsedTimer ()
 update the time duration watcher
 UtilTime ()
 Default Constructor.
virtual ~UtilTime ()
 Destructor.

Static Public Member Functions

static unsigned long getTicks ()
 get the current number of cpu ticks in usecs
static int nanoSleep (int nanoSecs)
 sleep a number of nanoseconds
static int nanoSleepSecs (int seconds)
 sleep a number of seconds
static void sleep (float Seconds)
 sleep a number of seconds (expressed as a float)


Detailed Description

Main UtilTime class.

This class provides static time routines for sleeping and finding the current time

It also can be instantiated to provide a time duration watcher

Definition at line 54 of file UtilTime.hpp.


Member Function Documentation

unsigned long UtilTime::getElapsedTime (  ) 

get the elapsed time

Get time since last update.

Get the elapsed time since last update and update the timer if desired

Definition at line 82 of file UtilTime.cpp.

References getTicks().

unsigned long UtilTime::getTicks (  )  [static]

get the current number of cpu ticks in usecs

Returns:
cpu ticks
Get the current number of cpu ticks in microseconds

Definition at line 66 of file UtilTime.cpp.

Referenced by getElapsedTime(), and updateElapsedTimer().

int UtilTime::nanoSleep ( int  nanoSecs  )  [static]

sleep a number of nanoseconds

wrapper for nanosleep

Parameters:
nanoSecs Time to sleep in nanoseconds
Returns:
actual time slept
sleep a number of nanoseconds

Definition at line 93 of file UtilTime.cpp.

Referenced by H::FileEventWatcher::addFileToWatch().

int UtilTime::nanoSleepSecs ( int  nanoSecs  )  [static]

sleep a number of seconds

wrapper for nanosleep which sleeps in seconds

Returns:
actual time slept
Sleep a number of seconds using the nanosleep function

Definition at line 113 of file UtilTime.cpp.

void UtilTime::sleep ( float  Seconds  )  [static]

sleep a number of seconds (expressed as a float)

Sleep a number of seconds (wrapper for nanosleep).

Parameters:
Seconds Time to sleep in seconds
Sleep a number of seconds (precise to the nanosecond)

Definition at line 133 of file UtilTime.cpp.

Referenced by H::SocketServer::shutdown().

void UtilTime::updateElapsedTimer (  ) 

update the time duration watcher

Update the time duration watcher

Definition at line 149 of file UtilTime.cpp.

References getTicks().

Referenced by UtilTime().


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 10:07:20 2007 for gizmod by  doxygen 1.5.3