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.


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

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:56:46 2008 by Doxygen version 1.5.5.