Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TimeET Class Reference

#include <TimeET.h>

Inheritance diagram for TimeET:

Inheritance graph
[legend]
List of all members.

Detailed Description

a nice class for handling time values with high precision

Definition at line 3 of file TimeET.cc.

Public Member Functions

TimeET Age () const
 returns the difference between the current time and the time stored
 TimeET ()
 constructor
 TimeET (long ms)
 constructor
 TimeET (time_t sec, long usec)
 constructor
 TimeET (const timeval &tval)
 constructor
 TimeET (const timespec &tspec)
 constructor
 TimeET (double t)
 constructor, sepecify t seconds
double Value () const
 returns the time stored as seconds in a double
 operator timeval & ()
 returns the time as a timeval system construct
 operator const timeval & () const
 returns the time as a const timeval system construct
 operator timespec ()
 returns the time as a timespec system construct (though the nanosecond resolution isn't actually retained)
time_t getSeconds () const
 returns the seconds portion (not rounded)
long getMilliseconds (long round=us_per_ms/2) const
 returns the millisecond representation (includes both seconds and microseconds contribution); pass 0 to round down, 1000 to round up, 500 to round nearest
long getMicroPortion () const
 returns the microseconds portion (doesn't include seconds)
void Set (long ms)
 sets the time stored in the class in terms of milliseconds
void Set (time_t sec, long usec)
 sets the time in terms of seconds and microseconds (aka timeval)
void Set (double t)
 sets the time in terms of floating-point seconds
void Set ()
 sets the time to the current time
bool operator< (long ms) const
 for comparing times
bool operator< (double t) const
 for comparing times
bool operator< (const TimeET &t) const
 for comparing times
TimeET operator+ (const TimeET &t) const
 for doing doing math with time
TimeET operator+= (const TimeET &t)
 for doing doing math with time
TimeET operator- (const TimeET &t) const
 for doing doing math with time
TimeET operator-= (const TimeET &t)
 for doing doing math with time
TimeET operator * (double x) const
 for doing doing math with time
TimeET operator *= (double x)
 for doing doing math with time
TimeET operator/ (double x) const
 for doing doing math with time
TimeET operator/= (double x)
 for doing doing math with time

Static Public Attributes

static const long us_per_sec = 1000000
 conversion factor for microseconds to seconds
static const long ms_per_sec = 1000
 conversion factor for milliseconds to seconds
static const long us_per_ms = 1000
 conversion factor for microseconds to milliseconds
static const long ns_per_us = 1000
 conversion factor for nanoseconds to microseconds

Protected Attributes

timeval tv
 stores the time

Static Protected Attributes

static struct timezone tz
 stores the timezone (not really used)

Friends

std::ostream & operator<< (std::ostream &o, const TimeET &t)
 lets the class be displayed easily


Member Function Documentation

void TimeET::Set (  )  [inline]

sets the time to the current time

Todo:
not getting timeofday on OPEN-R, is time since boot instead...

Definition at line 77 of file TimeET.h.

Referenced by Set(), and TimeET().


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

Tekkotsu v3.0
Generated Fri May 11 20:08:52 2007 by Doxygen 1.4.7