Thrill  0.1
StatsTimerBase< true > Class Template Reference

Detailed Description

template<>
class thrill::common::StatsTimerBase< true >

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 42 of file stats_timer.hpp.

+ Collaboration diagram for StatsTimerBase< true >:

#include <stats_timer.hpp>

Public Types

using duration = std::chrono::microseconds
 
using steady_clock = std::chrono::steady_clock
 
using time_point = std::chrono::steady_clock::time_point
 

Public Member Functions

 StatsTimerBase (bool start_immediately)
 Initialize and optionally immediately start the timer. More...
 
 StatsTimerBase (StatsTimerBase &&)=default
 move-constructor: default More...
 
duration Accumulated () const
 return currently accumulated time More...
 
std::chrono::microseconds::rep Microseconds () const
 return currently accumulated time in microseconds More...
 
std::chrono::milliseconds::rep Milliseconds () const
 return currently accumulated time in milliseconds More...
 
double MillisecondsDouble () const
 
StatsTimerBase & operator+= (const StatsTimerBase &tm)
 accumulate elapsed time from another timer More...
 
StatsTimerBase & operator= (StatsTimerBase &&)=default
 move-assignment operator: default More...
 
bool Real () const
 Whether the timer is real. More...
 
StatsTimerBase & Reset ()
 return accumulated time More...
 
bool running () const
 Whether the timer is running. More...
 
std::chrono::seconds::rep Seconds () const
 return currently accumulated time in seconds More...
 
double SecondsDouble () const
 
StatsTimerBase & Start ()
 start timer More...
 
StatsTimerBase & StartEventually ()
 start timer only if it not running More...
 
StatsTimerBase & Stop ()
 stop timer More...
 
StatsTimerBase & StopEventually ()
 stop timer if it is running More...
 

Protected Attributes

duration accumulated_
 total accumulated time in microseconds. More...
 
time_point last_start_
 last start time of the stop watch More...
 
common::AtomicMovable< bool > running_
 boolean whether the timer is currently running More...
 

Friends

std::ostream & operator<< (std::ostream &os, const StatsTimerBase &t)
 direct <<-operator for ostream. Can be used for printing with std::cout. More...
 
JsonLine & Put (JsonLine &line, const StatsTimerBase &t)
 

Member Typedef Documentation

◆ duration

using duration = std::chrono::microseconds

Definition at line 48 of file stats_timer.hpp.

◆ steady_clock

using steady_clock = std::chrono::steady_clock

Definition at line 45 of file stats_timer.hpp.

◆ time_point

using time_point = std::chrono::steady_clock::time_point

Definition at line 46 of file stats_timer.hpp.

Constructor & Destructor Documentation

◆ StatsTimerBase() [1/2]

StatsTimerBase ( bool  start_immediately)
inlineexplicit

Initialize and optionally immediately start the timer.

Definition at line 62 of file stats_timer.hpp.

◆ StatsTimerBase() [2/2]

StatsTimerBase ( StatsTimerBase< true > &&  )
default

move-constructor: default

Member Function Documentation

◆ Accumulated()

duration Accumulated ( ) const
inline

return currently accumulated time

Definition at line 121 of file stats_timer.hpp.

◆ Microseconds()

std::chrono::microseconds::rep Microseconds ( ) const
inline

return currently accumulated time in microseconds

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 132 of file stats_timer.hpp.

◆ Milliseconds()

std::chrono::milliseconds::rep Milliseconds ( ) const
inline

return currently accumulated time in milliseconds

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 138 of file stats_timer.hpp.

◆ MillisecondsDouble()

double MillisecondsDouble ( ) const
inline

return currently accumulated time in seconds as double with microseconds precision

Definition at line 157 of file stats_timer.hpp.

◆ operator+=()

StatsTimerBase& operator+= ( const StatsTimerBase< true > &  tm)
inline

accumulate elapsed time from another timer

Definition at line 162 of file stats_timer.hpp.

◆ operator=()

StatsTimerBase& operator= ( StatsTimerBase< true > &&  )
default

move-assignment operator: default

◆ Real()

bool Real ( ) const
inline

Whether the timer is real.

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 73 of file stats_timer.hpp.

◆ Reset()

StatsTimerBase& Reset ( )
inline

return accumulated time

Definition at line 114 of file stats_timer.hpp.

◆ running()

bool running ( ) const
inline

Whether the timer is running.

Definition at line 76 of file stats_timer.hpp.

◆ Seconds()

std::chrono::seconds::rep Seconds ( ) const
inline

return currently accumulated time in seconds

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 144 of file stats_timer.hpp.

◆ SecondsDouble()

double SecondsDouble ( ) const
inline

return currently accumulated time in seconds as double with microseconds precision

Definition at line 151 of file stats_timer.hpp.

◆ Start()

StatsTimerBase& Start ( )
inline

start timer

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 81 of file stats_timer.hpp.

◆ StartEventually()

StatsTimerBase& StartEventually ( )
inline

start timer only if it not running

Definition at line 89 of file stats_timer.hpp.

◆ Stop()

StatsTimerBase& Stop ( )
inline

stop timer

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 98 of file stats_timer.hpp.

◆ StopEventually()

StatsTimerBase& StopEventually ( )
inline

stop timer if it is running

Definition at line 107 of file stats_timer.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const StatsTimerBase< true > &  t 
)
friend

direct <<-operator for ostream. Can be used for printing with std::cout.

Definition at line 168 of file stats_timer.hpp.

◆ Put

JsonLine& Put ( JsonLine &  line,
const StatsTimerBase< true > &  t 
)
friend

Definition at line 172 of file stats_timer.hpp.

Member Data Documentation

◆ accumulated_

duration accumulated_
protected

total accumulated time in microseconds.

Definition at line 55 of file stats_timer.hpp.

◆ last_start_

time_point last_start_
protected

last start time of the stop watch

Definition at line 58 of file stats_timer.hpp.

◆ running_

common::AtomicMovable<bool> running_
protected

boolean whether the timer is currently running

Definition at line 52 of file stats_timer.hpp.


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