HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::util::CpuTimer Class Reference

Simple timer for basic profiling. More...

#include <CpuTimer.h>

Public Member Functions

 CpuTimer ()
 Initiate timer. More...
 
 CpuTimer (const std::string &msg)
 Prints message and re-start timer. More...
 
void start ()
 Start timer. More...
 
void start (const std::string &msg)
 Print message and re-start timer. More...
 
void restart (const std::string &msg)
 Stop previous timer, print message and re-start timer. More...
 
double delta () const
 Return Time diference in milliseconds since construction or start was called. More...
 
void stop () const
 Print time in milliseconds since construction or start was called. More...
 

Detailed Description

Simple timer for basic profiling.

CpuTimer timer;
// code here will not be timed!
timer.start("algorithm");
// code to be timed goes here
timer.stop();

or to time multiple blocks of code

CpuTimer timer("algorithm 1");
// code to be timed goes here
timer.restart("algorithm 2");
// code to be timed goes here
timer.stop();

Definition at line 63 of file CpuTimer.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::CpuTimer ( )
inline

Initiate timer.

Definition at line 68 of file CpuTimer.h.

openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::CpuTimer ( const std::string msg)
inline

Prints message and re-start timer.

Note
Should normally be followed by a call to stop()

Definition at line 73 of file CpuTimer.h.

Member Function Documentation

double openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::delta ( void  ) const
inline

Return Time diference in milliseconds since construction or start was called.

Definition at line 99 of file CpuTimer.h.

void openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::restart ( const std::string msg)
inline

Stop previous timer, print message and re-start timer.

Note
Should normally be followed by a call to stop()

Definition at line 92 of file CpuTimer.h.

void openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::start ( )
inline

Start timer.

Note
Should normally be followed by a call to time()

Definition at line 78 of file CpuTimer.h.

void openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::start ( const std::string msg)
inline

Print message and re-start timer.

Note
Should normally be followed by a call to stop()

Definition at line 83 of file CpuTimer.h.

void openvdb::OPENVDB_VERSION_NAME::util::CpuTimer::stop ( ) const
inline

Print time in milliseconds since construction or start was called.

Definition at line 106 of file CpuTimer.h.


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