synapse-app-sdk
C++ SDK for Synapse Apps
Loading...
Searching...
No Matches
synapse::Timer Class Reference

Timer class for tracking elapsed time intervals. More...

#include <time.hpp>

Public Member Functions

 Timer (double interval_seconds)
 Constructor for Timer.
bool has_elapsed () const
 Check if the specified interval has elapsed.
double elapsed_seconds () const
 Get elapsed time in seconds.
void reset ()
 Reset the timer to current time.
bool reset_if_elapsed ()
 Reset timer if interval has elapsed.

Detailed Description

Timer class for tracking elapsed time intervals.

Provides functionality to check if a specific time interval has elapsed.

Constructor & Destructor Documentation

◆ Timer()

synapse::Timer::Timer ( double interval_seconds)
inlineexplicit

Constructor for Timer.

Parameters
interval_secondsInterval duration in seconds

Member Function Documentation

◆ elapsed_seconds()

double synapse::Timer::elapsed_seconds ( ) const
inline

Get elapsed time in seconds.

Returns
Elapsed time in seconds since last reset

◆ has_elapsed()

bool synapse::Timer::has_elapsed ( ) const
inline

Check if the specified interval has elapsed.

Returns
true if interval has elapsed, false otherwise

◆ reset_if_elapsed()

bool synapse::Timer::reset_if_elapsed ( )
inline

Reset timer if interval has elapsed.

Returns
true if timer was reset, false otherwise

The documentation for this class was generated from the following file:
  • include/synapse-app-sdk/utils/time/time.hpp