Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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...
 
StatsTimerBaseoperator+= (const StatsTimerBase &tm)
 accumulate elapsed time from another timer More...
 
StatsTimerBaseoperator= (StatsTimerBase &&)=default
 move-assignment operator: default More...
 
bool Real () const
 Whether the timer is real. More...
 
StatsTimerBaseReset ()
 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
 
StatsTimerBaseStart ()
 start timer More...
 
StatsTimerBaseStartEventually ()
 start timer only if it not running More...
 
StatsTimerBaseStop ()
 stop timer More...
 
StatsTimerBaseStopEventually ()
 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...
 
JsonLinePut (JsonLine &line, const StatsTimerBase &t)
 

Member Typedef Documentation

using duration = std::chrono::microseconds

Definition at line 48 of file stats_timer.hpp.

using steady_clock = std::chrono::steady_clock

Definition at line 45 of file stats_timer.hpp.

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

Definition at line 46 of file stats_timer.hpp.

Constructor & Destructor Documentation

StatsTimerBase ( bool  start_immediately)
inlineexplicit

Initialize and optionally immediately start the timer.

Definition at line 62 of file stats_timer.hpp.

StatsTimerBase ( StatsTimerBase< true > &&  )
default

move-constructor: default

Member Function Documentation

duration Accumulated ( ) const
inline

return currently accumulated time

Definition at line 121 of file stats_timer.hpp.

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.

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.

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

accumulate elapsed time from another timer

Definition at line 156 of file stats_timer.hpp.

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

move-assignment operator: default

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.

StatsTimerBase& Reset ( )
inline

return accumulated time

Definition at line 114 of file stats_timer.hpp.

bool running ( ) const
inline

Whether the timer is running.

Definition at line 76 of file stats_timer.hpp.

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.

double SecondsDouble ( ) const
inline

return currently accumulated time in seconds as double with microseconds precision

Definition at line 151 of file stats_timer.hpp.

StatsTimerBase& Start ( )
inline

start timer

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 81 of file stats_timer.hpp.

StatsTimerBase& StartEventually ( )
inline

start timer only if it not running

Definition at line 89 of file stats_timer.hpp.

StatsTimerBase& Stop ( )
inline

stop timer

Examples:
tests/common/stats_timer_test.cpp.

Definition at line 98 of file stats_timer.hpp.

StatsTimerBase& StopEventually ( )
inline

stop timer if it is running

Definition at line 107 of file stats_timer.hpp.

Friends And Related Function Documentation

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 162 of file stats_timer.hpp.

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

Definition at line 166 of file stats_timer.hpp.

Member Data Documentation

duration accumulated_
protected

total accumulated time in microseconds.

Definition at line 55 of file stats_timer.hpp.

time_point last_start_
protected

last start time of the stop watch

Definition at line 58 of file stats_timer.hpp.

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: