LightsprintSDK 2021.08.08
rr::RRTime Class Reference

#include <RRDebug.h>

Public Member Functions

 RRTime (bool setNow=true)
 
void setNow ()
 
void addSeconds (float seconds)
 
float secondsPassed () const
 
float secondsSince (const RRTime &a) const
 
float secondsSinceLastQuery ()
 

Detailed Description

Accurate timer.

Constructor & Destructor Documentation

◆ RRTime()

rr::RRTime::RRTime ( bool  setNow = true)
explicit

By default, constructor updates time to current time. You can pass false to keep time uninitialized, but then don't call any other time function before setNow(), results would be random.

Member Function Documentation

◆ setNow()

void rr::RRTime::setNow ( )

Updates this time, "this = now".

◆ addSeconds()

void rr::RRTime::addSeconds ( float  seconds)

Modifies this time, "this += seconds".

◆ secondsPassed()

float rr::RRTime::secondsPassed ( ) const

Returns number of seconds passed, "now - this".

◆ secondsSince()

float rr::RRTime::secondsSince ( const RRTime a) const

Returns number of seconds since a, "this - a".

◆ secondsSinceLastQuery()

float rr::RRTime::secondsSinceLastQuery ( )

Returns number of seconds passed, "now - this", and updates this time, "this = now".