TmRealTime Class Reference
[Scheduler]

TmRealTime reads the getlocaltime() function, system clock to get the current number of microseconds. More...

#include <TmRealTime.h>

Inherits Marsyas::TmTimer.


Public Member Functions

mrs_natural getMicroSeconds ()
 get the system microseconds count
mrs_natural intervalsize (std::string interval)
 convert the given interval into a number of micro seconds.
mrs_natural readTimeSrc ()
 get the difference between the current source control value and its value since it was last read. Does not currently work for Windows TODO! architecture as it relies on the Unix function gettimeofday().
 TmRealTime (const TmRealTime &t)
 copy constructor
 TmRealTime (std::string name)
 named constructor. Given the identifier "TmRealTime/name"
 TmRealTime ()
 empty constructor. Given the default name: System as in "TmRealTime/System"
void updtime ()
 updtime from TmTimer is overridden to directly set the cur_time_ with the system time rather than an offset since last read. This should avoid possible accumulation of error.

Protected Attributes

int last_usecs_
 last read count of microseconds.


Detailed Description

TmRealTime reads the getlocaltime() function, system clock to get the current number of microseconds.

Author:
Neil Burroughs inb@cs.uvic.ca

Definition at line 40 of file TmRealTime.h.


Constructor & Destructor Documentation

TmRealTime ( std::string  name  ) 

named constructor. Given the identifier "TmRealTime/name"

Parameters:
name a unique name to call this timer

Definition at line 33 of file TmRealTime.cpp.

References TmRealTime::last_usecs_, and TmRealTime::readTimeSrc().

TmRealTime ( const TmRealTime t  ) 

copy constructor

Parameters:
t timer to copy

Definition at line 39 of file TmRealTime.cpp.

References TmTimer::name_.


Member Function Documentation

mrs_natural getMicroSeconds (  ) 

get the system microseconds count

Returns:
the microseconds count

Definition at line 47 of file TmRealTime.cpp.

Referenced by TmRealTime::readTimeSrc(), and TmRealTime::updtime().

mrs_natural intervalsize ( std::string  interval  )  [virtual]

convert the given interval into a number of micro seconds.

The interval must be defined in real time units: us, ms, s, m, h, d.

Parameters:
interval the interval to calculate
Returns:
the number of micro seconds contained in the interval

Implements TmTimer.

Definition at line 81 of file TmRealTime.cpp.

mrs_natural readTimeSrc (  )  [virtual]

get the difference between the current source control value and its value since it was last read. Does not currently work for Windows TODO! architecture as it relies on the Unix function gettimeofday().

Returns:
the count since last read

Implements TmTimer.

Definition at line 65 of file TmRealTime.cpp.

References TmRealTime::getMicroSeconds(), and TmRealTime::last_usecs_.

Referenced by TmRealTime::TmRealTime().


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

Generated on Wed May 23 00:02:23 2012 for Marsyas by  doxygen 1.5.6