43 d->start = std::chrono::steady_clock::now();
49 std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
50 int64_t result = std::chrono::duration_cast<std::chrono::milliseconds>(now - d->start).count();
58 std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
59 return std::chrono::duration_cast<std::chrono::milliseconds>(now - d->start).count();
65 std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
66 return std::chrono::duration_cast<std::chrono::nanoseconds>(now - d->start).count();
77 d->start += std::chrono::nanoseconds(nsecs);
The ElapsedTimer class provides a fast way to calculate elapsed times.
int64_t nsecsElapsed() const
Returns the number of nanoseconds since this ElapsedTimer was last started.
int64_t elapsed() const
Returns the number of milliseconds since this ElapsedTimer was last started.
int64_t restart()
Restarts the timer and returns the number of milliseconds elapsed since the previous start.
void nsecsRewind(int64_t nsecs)
Rewind elapsed time of nsec nanoseconds.
bool hasExpired(int64_t timeout) const
Returns true if this ElapsedTimer has already expired by timeout milliseconds.
void start()
Starts this timer. Once started, a timer value can be checked with elapsed().
Namespace to encapsulate INDI client, drivers, and mediator classes.