vSMC
vSMC: Scalable Monte Carlo
Public Types | Public Member Functions | List of all members
vsmc::StopWatchClockAdapter< ClockType > Class Template Reference

StopWatch as an adapter of C++11 clock. More...

#include <vsmc/utility/stop_watch.hpp>

Public Types

typedef ClockType clock_type
 

Public Member Functions

 StopWatchClockAdapter ()
 
double hours () const
 Return the accumulated elapsed time in hours. More...
 
double microseconds () const
 Return the accumulated elapsed time in microseconds. More...
 
double milliseconds () const
 Return the accumulated elapsed time in milliseconds. More...
 
double minutes () const
 Return the accumulated elapsed time in minutes. More...
 
double nanoseconds () const
 Return the accumulated elapsed time in nanoseconds. More...
 
void reset ()
 Stop and reset the elapsed time to zero. More...
 
bool running () const
 If the watch is running. More...
 
double seconds () const
 Return the accumulated elapsed time in seconds. More...
 
bool start ()
 Start the watch, no effect if already started. More...
 
bool stop ()
 Stop the watch, no effect if already stopped. More...
 

Detailed Description

template<typename ClockType>
class vsmc::StopWatchClockAdapter< ClockType >

StopWatch as an adapter of C++11 clock.

Definition at line 117 of file stop_watch.hpp.

Member Typedef Documentation

template<typename ClockType >
typedef ClockType vsmc::StopWatchClockAdapter< ClockType >::clock_type

Definition at line 121 of file stop_watch.hpp.

Constructor & Destructor Documentation

template<typename ClockType >
vsmc::StopWatchClockAdapter< ClockType >::StopWatchClockAdapter ( )
inline

Definition at line 123 of file stop_watch.hpp.

Member Function Documentation

template<typename ClockType >
double vsmc::StopWatchClockAdapter< ClockType >::hours ( ) const
inline

Return the accumulated elapsed time in hours.

Definition at line 210 of file stop_watch.hpp.

template<typename ClockType >
double vsmc::StopWatchClockAdapter< ClockType >::microseconds ( ) const
inline

Return the accumulated elapsed time in microseconds.

Definition at line 182 of file stop_watch.hpp.

template<typename ClockType >
double vsmc::StopWatchClockAdapter< ClockType >::milliseconds ( ) const
inline

Return the accumulated elapsed time in milliseconds.

Definition at line 189 of file stop_watch.hpp.

template<typename ClockType >
double vsmc::StopWatchClockAdapter< ClockType >::minutes ( ) const
inline

Return the accumulated elapsed time in minutes.

Definition at line 203 of file stop_watch.hpp.

template<typename ClockType >
double vsmc::StopWatchClockAdapter< ClockType >::nanoseconds ( ) const
inline

Return the accumulated elapsed time in nanoseconds.

Definition at line 175 of file stop_watch.hpp.

template<typename ClockType >
void vsmc::StopWatchClockAdapter< ClockType >::reset ( )
inline

Stop and reset the elapsed time to zero.

Definition at line 167 of file stop_watch.hpp.

template<typename ClockType >
bool vsmc::StopWatchClockAdapter< ClockType >::running ( ) const
inline

If the watch is running.

If start() has been called and no stop() call since, then it is running, otherwise it is stoped.

Definition at line 130 of file stop_watch.hpp.

template<typename ClockType >
double vsmc::StopWatchClockAdapter< ClockType >::seconds ( ) const
inline

Return the accumulated elapsed time in seconds.

Definition at line 196 of file stop_watch.hpp.

template<typename ClockType >
bool vsmc::StopWatchClockAdapter< ClockType >::start ( )
inline

Start the watch, no effect if already started.

Returns
true if it is started by this call, and the elapsed time will be incremented next time stop() is called. The increment will be relative to the time point of this call. false if it is already started earlier.

Definition at line 138 of file stop_watch.hpp.

template<typename ClockType >
bool vsmc::StopWatchClockAdapter< ClockType >::stop ( )
inline

Stop the watch, no effect if already stopped.

Returns
true if it is stoped by this call, and the elapsed time has been incremented. false if it is already stopped or wasn't started before.

Definition at line 154 of file stop_watch.hpp.