
A simple wrapper around timeval. More...
#include <rutz/time.h>
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. | |
| time & | operator= (const time &x) throw () |
| Assignment operator. | |
| time | operator+ (const time &t2) const throw () |
| Addition operator. | |
| time & | operator+= (const time &t2) throw () |
| In-place addition operator. | |
| time | operator- (const time &t2) const throw () |
| Subtraction operator. | |
| time & | operator-= (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. | |
A simple wrapper around timeval.
All operations provide the no-throw guarantee.
Definition at line 50 of file time.h.
| 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] |
| rutz::time::time | ( | unsigned long | s, | |
| long | us | |||
| ) | throw () [inline] |
| rutz::time::time | ( | const time & | x | ) | throw () [inline] |
| double rutz::time::msec | ( | ) | const throw () [inline] |
| rutz::time::operator const timeval & | ( | ) | const throw () [inline] |
| bool rutz::time::operator< | ( | const time & | t2 | ) | const throw () [inline] |
| bool rutz::time::operator<= | ( | const time & | t2 | ) | const throw () [inline] |
| bool rutz::time::operator== | ( | const time & | t2 | ) | const throw () [inline] |
| bool rutz::time::operator> | ( | const time & | t2 | ) | const throw () [inline] |
| bool rutz::time::operator>= | ( | const time & | t2 | ) | const throw () [inline] |
| 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] |
| 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] |
Create a time representing current wall-clock time.
Definition at line 42 of file time.cc.
Referenced by rutz::stopwatch::elapsed(), rutz::prof::get_now_time(), FpsTimer::nextFrame(), BobDeinterlacer::readFrame(), ColorbarsInput::readFrame(), rutz::stopwatch::restart(), BufferedFrameIstream::startStream(), submain(), and InfoOutputSeries::writeFrame().
1.6.3