Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::ScopedClock< Clock > Class Template Reference

#include <clock.h>

+ Inheritance diagram for inviwo::ScopedClock< Clock >:

Public Member Functions

 ScopedClock (const std::string &logSource, const std::string &message, typename Clock::duration logIfAtLeast=typename Clock::duration{}, LogLevel logLevel=LogLevel::Info)
 
 ScopedClock (const std::string &logSource, const std::string &message, double logIfAtLeastMilliSec, LogLevel logLevel=LogLevel::Info)
 
void print ()
 
void printAndReset ()
 
- Public Member Functions inherited from inviwo::Clock
 Clock ()
 
bool isRunning () const
 
void start ()
 
void stop ()
 
void reset ()
 
duration getElapsedTime () const
 
double getElapsedMilliseconds () const
 
double getElapsedSeconds () const
 

Additional Inherited Members

- Public Types inherited from inviwo::Clock
using clock = std::chrono::high_resolution_clock
 
using duration = std::chrono::high_resolution_clock::duration
 
using time_point = std::chrono::high_resolution_clock::time_point
 
- Protected Attributes inherited from inviwo::Clock
bool isRunning_ = false
 
time_point startTime_
 
duration accumulatedTime_ = static_cast<duration>(0)
 

Detailed Description

template<typename Clock>
class inviwo::ScopedClock< Clock >

Scoped clock which prints the elapsed time when the instance is destroyed, i.e. print() is called by the destructor.

See also
ScopedClockCPU, ScopedClockGL

Member Function Documentation

◆ print()

template<typename Clock >
void inviwo::ScopedClock< Clock >::print ( )

log the accumulated time but only if it is larger than the duration threshold (logIfAtLeast) given in the constructor.

◆ printAndReset()

template<typename Clock >
void inviwo::ScopedClock< Clock >::printAndReset ( )

log the accumulated time but only if it is larger than the duration threshold (logIfAtLeast) given in the constructor. Also resets the clock and restarts it.


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