Instrument Neutral Distributed Interface INDI  2.0.2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INDI::ElapsedTimer Class Reference

The ElapsedTimer class provides a fast way to calculate elapsed times. More...

#include <indielapsedtimer.h>

Public Member Functions

 ElapsedTimer ()
 
virtual ~ElapsedTimer ()
 
void start ()
 Starts this timer. Once started, a timer value can be checked with elapsed(). More...
 
int64_t restart ()
 Restarts the timer and returns the number of milliseconds elapsed since the previous start. More...
 
int64_t elapsed () const
 Returns the number of milliseconds since this ElapsedTimer was last started. More...
 
int64_t nsecsElapsed () const
 Returns the number of nanoseconds since this ElapsedTimer was last started. More...
 
bool hasExpired (int64_t timeout) const
 Returns true if this ElapsedTimer has already expired by timeout milliseconds. More...
 
void nsecsRewind (int64_t nsecs)
 Rewind elapsed time of nsec nanoseconds. More...
 

Protected Member Functions

 ElapsedTimer (ElapsedTimerPrivate &dd)
 

Protected Attributes

std::unique_ptr< ElapsedTimerPrivated_ptr
 

Detailed Description

The ElapsedTimer class provides a fast way to calculate elapsed times.

The ElapsedTimer class is usually used to quickly calculate how much time has elapsed between two events.

Examples
simpleccd.h.

Definition at line 35 of file indielapsedtimer.h.

Constructor & Destructor Documentation

◆ ElapsedTimer() [1/2]

INDI::ElapsedTimer::ElapsedTimer ( )

Definition at line 25 of file indielapsedtimer.cpp.

◆ ~ElapsedTimer()

INDI::ElapsedTimer::~ElapsedTimer ( )
virtual

Definition at line 37 of file indielapsedtimer.cpp.

◆ ElapsedTimer() [2/2]

INDI::ElapsedTimer::ElapsedTimer ( ElapsedTimerPrivate dd)
protected

Definition at line 31 of file indielapsedtimer.cpp.

Member Function Documentation

◆ elapsed()

int64_t INDI::ElapsedTimer::elapsed ( ) const

Returns the number of milliseconds since this ElapsedTimer was last started.

Examples
simpleccd.cpp.

Definition at line 55 of file indielapsedtimer.cpp.

◆ hasExpired()

bool INDI::ElapsedTimer::hasExpired ( int64_t  timeout) const

Returns true if this ElapsedTimer has already expired by timeout milliseconds.

Definition at line 69 of file indielapsedtimer.cpp.

◆ nsecsElapsed()

int64_t INDI::ElapsedTimer::nsecsElapsed ( ) const

Returns the number of nanoseconds since this ElapsedTimer was last started.

Definition at line 62 of file indielapsedtimer.cpp.

◆ nsecsRewind()

void INDI::ElapsedTimer::nsecsRewind ( int64_t  nsecs)

Rewind elapsed time of nsec nanoseconds.

Definition at line 74 of file indielapsedtimer.cpp.

◆ restart()

int64_t INDI::ElapsedTimer::restart ( )

Restarts the timer and returns the number of milliseconds elapsed since the previous start.

Definition at line 46 of file indielapsedtimer.cpp.

◆ start()

void INDI::ElapsedTimer::start ( )

Starts this timer. Once started, a timer value can be checked with elapsed().

Examples
simpleccd.cpp.

Definition at line 40 of file indielapsedtimer.cpp.

Member Data Documentation

◆ d_ptr

std::unique_ptr<ElapsedTimerPrivate> INDI::ElapsedTimer::d_ptr
protected

Definition at line 64 of file indielapsedtimer.h.


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