vSMC
vSMC: Scalable Monte Carlo
|
CPU clock cycle counter using rdtscp
More...
#include <vsmc/utility/rdtsc.hpp>
Public Member Functions | |
RDTSCPCounter () | |
uint64_t | cycles () const |
Return the accumulated elapsed cycle count. More... | |
void | reset () |
Stop and reset the elapsed cycle count to zero. More... | |
bool | running () const |
If the counter is running. More... | |
bool | start () |
Start the counter, no effect if already started. More... | |
bool | stop () |
Stop the counter, no effect if already stopped. More... | |
CPU clock cycle counter using rdtscp
This class shall only be used if RDTSCP is supported. For example,
|
inline |
|
inline |
|
inline |
|
inline |
Start the counter, no effect if already started.
true
if it is started by this call, and the elapsed cycle count 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.
|
inline |
Stop the counter, no effect if already stopped.
true
if it is stoped by this call, and the elapsed cycle count has been incremented. false
in one of the following situations. In all these situations, the elapsed cycle count will not be incremented.start()
call. The user is repsonsible for assure threads affinity.