Inviwo 0.9.12-pre
Inviwo documentation
|
#include <clock.h>
Public Types | |
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 | |
Clock () | |
bool | isRunning () const |
void | start () |
void | stop () |
void | reset () |
duration | getElapsedTime () const |
double | getElapsedMilliseconds () const |
double | getElapsedSeconds () const |
Protected Attributes | |
bool | isRunning_ = false |
time_point | startTime_ |
duration | accumulatedTime_ = static_cast<duration>(0) |
Clock for measuring elapsed time between a start and stop point. The clock accumulates the elapsed times when start and stop are called multiple times.
inviwo::Clock::Clock | ( | ) |
creates a clock and starts it
double inviwo::Clock::getElapsedMilliseconds | ( | ) | const |
returns the accumulated time. If the clock is running the result is accumulated time plus the current elapsed time.
double inviwo::Clock::getElapsedSeconds | ( | ) | const |
returns the accumulated time. If the clock is running the result is accumulated time plus the current elapsed time.
duration inviwo::Clock::getElapsedTime | ( | ) | const |
returns the accumulated time. If the clock is running the result is accumulated time plus the current elapsed time.
bool inviwo::Clock::isRunning | ( | ) | const |
query whether the clock has been started
void inviwo::Clock::reset | ( | ) |
resets the accumulated time to 0
void inviwo::Clock::start | ( | ) |
starts the clock
void inviwo::Clock::stop | ( | ) |
stops the clock and accumulates the elapsed time since start() was called