OpenVDB 11.0.0

Loading...
Searching...
No Matches
CpuTimer Class Reference

`#include <nanovdb/util/CpuTimer.h>`

## Public Member Functions
| CpuTimer ()
| Default constructor.
| CpuTimer (const std::string &msg, std::ostream &os=std::cerr)
| Constructor that starts the timer.
void | start (const std::string &msg, std::ostream &os=std::cerr)
| Start the timer.
template<typename AccuracyT = std::chrono::milliseconds>
auto | elapsed ()
| elapsed time (since start) in miliseconds
template<typename AccuracyT = std::chrono::milliseconds>
void | stop (std::ostream &os=std::cerr)
| stop the timer
template<typename AccuracyT = std::chrono::milliseconds>
void | restart (const std::string &msg, std::ostream &os=std::cerr)
| stop and start the timer

## Constructor & Destructor Documentation

## ◆ CpuTimer() [1/2]

CpuTimer | ( |  | ) |
| inline

Default constructor.

## ◆ CpuTimer() [2/2]

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

Constructor that starts the timer.

Parameters

  msg | string message to be printed when timer is started
  os | output stream for the message above

## Member Function Documentation

## ◆ elapsed()

template<typename AccuracyT = std::chrono::milliseconds>

auto elapsed | ( |  | ) |
| inline

elapsed time (since start) in miliseconds

## ◆ restart()

template<typename AccuracyT = std::chrono::milliseconds>

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

stop and start the timer

Template Parameters

  AccuracyT | Template parameter defining the accuracy of the reported times

Parameters

  msg | string message to be printed when timer is started
  os | output stream for the message above

## ◆ start()

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

Start the timer.

Parameters

  msg | string message to be printed when timer is started
  os | output stream for the message above

## ◆ stop()

template<typename AccuracyT = std::chrono::milliseconds>

void stop | ( | std::ostream & | os = std::cerr | ) |
| inline

stop the timer

Template Parameters

  AccuracyT | Template parameter defining the accuracy of the reported times

Parameters

  os | output stream for the message above