rutz::time Class Reference

A simple wrapper around timeval. More...

#include <rutz/time.h>

List of all members.

Public Member Functions

 time () throw ()
 Construct with time=0.
 time (const timeval &t) throw ()
 Construct from a timeval.
 time (unsigned long s, long us) throw ()
 Construct with given seconds+microseconds values.
 time (double ss) throw ()
 time (const time &x) throw ()
 Copy construct.
 ~time () throw ()
 Destruct.
void reset (unsigned long s=0, long us=0) throw ()
 Reset to given seconds+microseconds values.
timeoperator= (const time &x) throw ()
 Assignment operator.
time operator+ (const time &t2) const throw ()
 Addition operator.
timeoperator+= (const time &t2) throw ()
 In-place addition operator.
time operator- (const time &t2) const throw ()
 Subtraction operator.
timeoperator-= (const time &t2) throw ()
 In-place subtraction operator.
bool operator< (const time &t2) const throw ()
 Less-than comparison.
bool operator<= (const time &t2) const throw ()
 Less-than-or-equal comparison.
bool operator== (const time &t2) const throw ()
 Equality comparison.
bool operator> (const time &t2) const throw ()
 Greater-than comparison.
bool operator>= (const time &t2) const throw ()
 Greater-than-or-equal comparison.
double sec () const throw ()
 Return time in floating-point seconds.
double msec () const throw ()
 Return time in floating-point milliseconds.
double usec () const throw ()
 Return time in floating-point microseconds.
const timeval & tval () const throw ()
 Return internal timeval.
 operator const timeval & () const throw ()
 Conversion operator to timeval.

Static Public Member Functions

static time wall_clock_now () throw ()
 Create a time representing current wall-clock time.
static time user_rusage () throw ()
 Create a time representing the current process's user cpu usage.
static time sys_rusage () throw ()
 Create a time representing the current process's sys cpu usage.
static time rusage_now () throw ()
 Create a time representing the current process's total user+sys cpu usage.

Detailed Description

A simple wrapper around timeval.

All operations provide the no-throw guarantee.

Definition at line 50 of file time.h.


Constructor & Destructor Documentation

rutz::time::time (  )  throw () [inline]

Construct with time=0.

Definition at line 54 of file time.h.

References reset().

Referenced by operator+(), operator-(), sys_rusage(), and user_rusage().

rutz::time::time ( const timeval &  t  )  throw () [inline]

Construct from a timeval.

Definition at line 60 of file time.h.

rutz::time::time ( unsigned long  s,
long  us 
) throw () [inline]

Construct with given seconds+microseconds values.

Definition at line 66 of file time.h.

References reset().

rutz::time::time ( const time x  )  throw () [inline]

Copy construct.

Definition at line 79 of file time.h.

rutz::time::~time (  )  throw () [inline]

Destruct.

Definition at line 82 of file time.h.


Member Function Documentation

double rutz::time::msec (  )  const throw () [inline]

Return time in floating-point milliseconds.

Definition at line 208 of file time.h.

rutz::time::operator const timeval & (  )  const throw () [inline]

Conversion operator to timeval.

Definition at line 226 of file time.h.

time rutz::time::operator+ ( const time t2  )  const throw () [inline]

Addition operator.

Definition at line 113 of file time.h.

References time().

time& rutz::time::operator+= ( const time t2  )  throw () [inline]

In-place addition operator.

Definition at line 125 of file time.h.

time rutz::time::operator- ( const time t2  )  const throw () [inline]

Subtraction operator.

Definition at line 136 of file time.h.

References time().

time& rutz::time::operator-= ( const time t2  )  throw () [inline]

In-place subtraction operator.

Definition at line 148 of file time.h.

bool rutz::time::operator< ( const time t2  )  const throw () [inline]

Less-than comparison.

Definition at line 159 of file time.h.

bool rutz::time::operator<= ( const time t2  )  const throw () [inline]

Less-than-or-equal comparison.

Definition at line 168 of file time.h.

time& rutz::time::operator= ( const time x  )  throw () [inline]

Assignment operator.

Definition at line 106 of file time.h.

bool rutz::time::operator== ( const time t2  )  const throw () [inline]

Equality comparison.

Definition at line 177 of file time.h.

bool rutz::time::operator> ( const time t2  )  const throw () [inline]

Greater-than comparison.

Definition at line 184 of file time.h.

bool rutz::time::operator>= ( const time t2  )  const throw () [inline]

Greater-than-or-equal comparison.

Definition at line 193 of file time.h.

void rutz::time::reset ( unsigned long  s = 0,
long  us = 0 
) throw () [inline]

Reset to given seconds+microseconds values.

Definition at line 98 of file time.h.

Referenced by convertFromString(), rutz::prof::reset(), and time().

static time rutz::time::rusage_now (  )  throw () [inline, static]

Create a time representing the current process's total user+sys cpu usage.

Definition at line 94 of file time.h.

References sys_rusage(), and user_rusage().

double rutz::time::sec (  )  const throw () [inline]

Return time in floating-point seconds.

Definition at line 202 of file time.h.

Referenced by convertToString(), and ColorbarsInput::readFrame().

rutz::time rutz::time::sys_rusage (  )  throw () [static]

Create a time representing the current process's sys cpu usage.

Definition at line 56 of file time.cc.

References time().

Referenced by rutz::prof::get_now_time(), and rusage_now().

const timeval& rutz::time::tval (  )  const throw () [inline]

Return internal timeval.

Definition at line 220 of file time.h.

double rutz::time::usec (  )  const throw () [inline]

Return time in floating-point microseconds.

Definition at line 214 of file time.h.

Referenced by rutz::prof::self_time(), and rutz::prof::total_time().

rutz::time rutz::time::user_rusage (  )  throw () [static]

Create a time representing the current process's user cpu usage.

Definition at line 49 of file time.cc.

References time().

Referenced by rutz::prof::get_now_time(), and rusage_now().

rutz::time rutz::time::wall_clock_now (  )  throw () [static]

The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:44 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3