Geophysical Inversion and Modeling Library  v1.0.12-3-g179296b4
GIMLI::Stopwatch Class Reference
+ Collaboration diagram for GIMLI::Stopwatch:

Public Member Functions

 Stopwatch (bool start=false)
void start ()
void stop (bool verbose=false)
void restart ()
void reset ()
double duration (bool restart=false)
size_t cycles (bool restart=false)
const CycleCountercycleCounter () const

Protected Types

enum  watchstate { undefined, halted, running }

Protected Attributes

timeb starttime
timeb stoptime
enum GIMLI::Stopwatch::watchstate state_
CycleCounter cCounter_

Member Function Documentation

◆ cycles()

size_t GIMLI::Stopwatch::cycles ( bool  restart = false)

Returns the cpu cycles. Optional you can restart the stopwatch.

References restart().

◆ duration()

◆ reset()

void GIMLI::Stopwatch::reset ( )

Reset the stopwatch, same like restart.

References restart().

◆ restart()

void GIMLI::Stopwatch::restart ( )

Restart the stopwatch.

Referenced by cycles(), duration(), and reset().