TimeStamp

Declared in lemon/time_measure.h, in the group Time Measuring and Counting; the same class on the Doxygen site.

class TimeStamp

A class to store (cpu)time instances.

This class stores five time values.

  • a real time

  • a user cpu time

  • a system cpu time

  • a user cpu time of children

  • a system cpu time of children

The real time is that of std::chrono::steady_clock, and the user cpu time is the processor time of the process that std::clock() gives, which also counts the time spent in the system on its behalf; the other three are zero, as no standard facility gives them.

TimeStamp’s can be added to or substracted from each other and they can be pushed to a stream.

In most cases, perhaps the Timer or the TimeReport class is what you want to use instead.

Public Types

enum Format

Display format specifier.

Values:

enumerator NORMAL

Reports all measured values.

enumerator SHORT

Only real time and an error indicator is displayed.

Public Functions

inline void stamp()

Read the current time values of the process.

inline TimeStamp()

Constructor initializing with zero.

inline TimeStamp(void*)

Constructor initializing with the current time values of the process.

inline TimeStamp & reset()

Set every time value to zero.

inline TimeStamp & operator+=( const TimeStamp & b )

inline TimeStamp operator+( const TimeStamp & b ) const

inline TimeStamp & operator-=( const TimeStamp & b )

inline TimeStamp operator-( const TimeStamp & b ) const

inline TimeStamp & operator*=( double b )

inline TimeStamp operator*( double b ) const

inline TimeStamp & operator/=( double b )

inline TimeStamp operator/( double b ) const

inline TimeStamp ellapsed() const

The time ellapsed since the last call of stamp().

inline double userTime() const

Gives back the user time of the process.

inline double systemTime() const

Gives back the system time of the process.

inline double cUserTime() const

Gives back the user time of the process’ children.

Note

It is always zero, as no standard facility gives it.

inline double cSystemTime() const

Gives back the user time of the process’ children.

Note

It is always zero, as no standard facility gives it.

inline double realTime() const

Gives back the real time.

Public Static Functions

static inline void format( Format f )

Set output format.

The output format is global for all timestamp instances.

static inline Format format()

Retrieve the current output format.

Retrieve the current output format

The output format is global for all timestamp instances.

Friends

friend TimeStamp operator*( double b , const TimeStamp & t )
friend std::ostream & operator<<( std::ostream & os , const TimeStamp & t )