#include <clock.h>
Public Types | |
using | Duration = Clock::duration |
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 |
Public Member Functions | |
ScopedClock (Callback message, Duration logIfAtLeast={}, LogLevel logLevel=LogLevel::Info, SourceContext context=std::source_location::current()) | |
ScopedClock (const ScopedClock &)=delete | |
ScopedClock (ScopedClock &&)=delete | |
ScopedClock & | operator= (const ScopedClock &)=delete |
ScopedClock & | operator= (ScopedClock &&)=delete |
void | print () const |
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 | |
Protected Attributes inherited from inviwo::Clock | |
bool | isRunning_ = false |
time_point | startTime_ |
duration | accumulatedTime_ = static_cast<duration>(0) |
Scoped clock which prints the elapsed time when the instance is destroyed, i.e. print() is called by the destructor.
void inviwo::ScopedClock< Clock, Callback >::print | ( | ) | const |
log the accumulated time but only if it is larger than the duration threshold (logIfAtLeast) given in the constructor.
void inviwo::ScopedClock< Clock, Callback >::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.