TimeVal();The first represents a time interval of zero. In the second case, the
TimeVal(double seconds);
seconds
argument is rounded to the nearest microsecond. These classes rely on features found in BSD-based Unix systems and newer System V Unix systems. Older System V systems tend not to provide the ability to sleep for a time specified more accurately than a second.
operator double() const;This returns the interval value as a double.
TimeVal operator +(const TimeVal& arg) const;These operators do simple addition and subtraction of TimeVals.
TimeVal operator -(const TimeVal& arg) const;
TimeVal& operator +=(const TimeVal& arg);
TimeVal& operator -=(const TimeVal& arg);
int operator >(const TimeVal& arg) const;These operators do simple comparisons of TimeVals.
int operator <(const TimeVal& arg) const;
Class Clock provides a simple interface to the system clock for measurement of actual elapsed time. It has an internal TimeVal field that represents the starting time of a time interval.
Clock();The constructor creates a Clock with starting time equal to the time at which the constructor is executed.
void reset();This method resets the start time to "now".
TimeVal elapsedTime() const;This method returns the elapsed time since the last
reset
or the call to the constructor.
int sleepUntil(const TimeVal& howLong) const;This method causes the process to sleep until
howLong
after the start time.