OpenVDB  12.0.1
Public Member Functions | List of all members
Timer Class Reference

#include <nanovdb/util/Timer.h>

Public Member Functions

 Timer ()
 Default constructor. More...
 
 Timer (const std::string &msg, std::ostream &os=std::cerr)
 Constructor that starts the timer. More...
 
void start (const std::string &msg, std::ostream &os=std::cerr)
 Start the timer. More...
 
void record ()
 Record the stop time so the elapsed time since start can be computed. More...
 
float milliseconds () const
 Returns the time in milliseconds since record was called. More...
 
template<typename AccuracyT = std::chrono::milliseconds>
auto elapsed ()
 call record and return the elapsed time (since start) in miliseconds More...
 
template<typename AccuracyT = std::chrono::milliseconds>
void stop (std::ostream &os=std::cerr)
 stop the timer and print elapsed time to a stream More...
 
template<typename AccuracyT = std::chrono::milliseconds>
void restart (const std::string &msg, std::ostream &os=std::cerr)
 stop and start the timer again More...
 

Constructor & Destructor Documentation

Timer ( )
inline

Default constructor.

Timer ( const std::string &  msg,
std::ostream &  os = std::cerr 
)
inline

Constructor that starts the timer.

Parameters
msgstring message to be printed when timer is started
osoutput stream for the message above

Member Function Documentation

auto elapsed ( )
inline

call record and return the elapsed time (since start) in miliseconds

float milliseconds ( ) const
inline

Returns the time in milliseconds since record was called.

void record ( )
inline

Record the stop time so the elapsed time since start can be computed.

void restart ( const std::string &  msg,
std::ostream &  os = std::cerr 
)
inline

stop and start the timer again

Template Parameters
AccuracyTTemplate parameter defining the accuracy of the reported times
Parameters
msgstring message to be printed when timer is started
osoutput stream for the message above
void start ( const std::string &  msg,
std::ostream &  os = std::cerr 
)
inline

Start the timer.

Parameters
msgstring message to be printed when timer is started
osoutput stream for the message above
void stop ( std::ostream &  os = std::cerr)
inline

stop the timer and print elapsed time to a stream

Template Parameters
AccuracyTTemplate parameter defining the accuracy of the reported times
Parameters
osoutput stream for the message above