Givaro
Public Member Functions
Timer Class Reference

Timer. More...

#include <givtimer.h>

Public Member Functions

 Timer ()
 
void clear ()
 Clear timer. More...
 
void start ()
 Start timer. More...
 
void stop ()
 Stop timer. More...
 
double usertime () const
 total amount of second spent in user mode. More...
 
double systime () const
 total amount of second spent in system mode. More...
 
double realtime () const
 real total amount of second spent. More...
 
double userElapsedTime ()
 User mode time spent since start. More...
 
double sysElapsedTime ()
 System mode time spent since start. More...
 
double realElapsedTime ()
 real total amount of second spent since start. More...
 
Timeroperator= (const Timer &T)
 
const Timer operator- (const Timer &T) const
 
const Timer operator- ()
 
const Timer operator+ (const Timer &T) const
 
const Timer operator/ (const double) const
 
Timeroperator+= (const Timer &T)
 
Timeroperator-= (const Timer &T)
 
Timeroperator/= (const double d)
 
std::ostream & print (std::ostream &) const
 
size_t count () const
 

Detailed Description

Timer.

Examples
examples/Integer/Fibonacci.C.

Constructor & Destructor Documentation

◆ Timer()

Timer ( )
inline

Member Function Documentation

◆ clear()

void clear ( )

Clear timer.

Everything reset to 0. This need not be called before the first start since the constructor does it.

Examples
examples/Polynomial/highorder.C.

◆ start()

void start ( )

Start timer.

Starts the timer. If called after another start() or a stop(), it sets the timer to a totally fresh new start.

Examples
examples/Integer/Fibonacci.C.

◆ stop()

void stop ( )

Stop timer.

Stops the timer. The time since the previous start() is stored. If called again, stop() will store the time since the previous start() again, acting as a pause().

Precondition
start() should have been called before...
Examples
examples/Integer/Fibonacci.C.

◆ usertime()

double usertime ( ) const
inline

total amount of second spent in user mode.

Returns
the user time elapsed between the latest start() and the latest stop().
Precondition
stop() is called before.

◆ systime()

double systime ( ) const
inline

total amount of second spent in system mode.

Returns
the system time elapsed between the latest start() and the latest stop().
Precondition
stop() is called before.

◆ realtime()

double realtime ( ) const
inline

real total amount of second spent.

Returns
the real total time elapsed between the latest start() and the latest stop().
Precondition
stop() is called before.

◆ userElapsedTime()

double userElapsedTime ( )
inline

User mode time spent since start.

A call to stop() is useless.

Returns
elpased time (in seconds) since start() in user mode.

◆ sysElapsedTime()

double sysElapsedTime ( )
inline

System mode time spent since start.

A call to stop() is useless.

Returns
elpased time (in seconds) since start() in system mode.

◆ realElapsedTime()

double realElapsedTime ( )
inline

real total amount of second spent since start.

A call to stop() is useless.

Returns
elpased time (in seconds) since start().

◆ operator=()

Timer & operator= ( const Timer T)

◆ operator-() [1/2]

const Timer operator- ( const Timer T) const

◆ operator-() [2/2]

const Timer operator- ( )

◆ operator+()

const Timer operator+ ( const Timer T) const

◆ operator/()

const Timer operator/ ( const double  nbiter) const

◆ operator+=()

Timer& operator+= ( const Timer T)
inline

◆ operator-=()

Timer& operator-= ( const Timer T)
inline

◆ operator/=()

Timer& operator/= ( const double  d)
inline

◆ print()

std::ostream & print ( std::ostream &  o) const

◆ count()

size_t count ( ) const
inline

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