CPP-TOOLBOX
Loading...
Searching...
No Matches
periodic_signal.hpp File Reference
#include <algorithm>
#include <chrono>
#include <cmath>

Go to the source code of this file.

Classes

class  PeriodicSignal
 A class for generating periodic signals based on a specified rate with different operation modes. More...
 

Enumerations

enum class  OperationMode { PERFECT_DELTAS , MEASURED_DELTAS }
 the operation mode indicates how the delta times are computed in the PeriodicSignal More...
 

Enumeration Type Documentation

◆ OperationMode

enum class OperationMode
strong

the operation mode indicates how the delta times are computed in the PeriodicSignal

with perfect detlas, when enough time has elapsed for a delta time to have occurred, then it's reported that the last delta time is given by 1/freq, ie the exact period, and not the actual measured time, this is good for when you want to be able to reliably use the same delta time over and over for stability in certain systems, one example is in client prediction and server reconciliation to guarentee that both systems use the same delta time to keep their results similar

measured deltas are exactly what they sound like and report how much time has actually passed since the last time the periodic signal was checked and was ready to emit the signal

Enumerator
PERFECT_DELTAS 
MEASURED_DELTAS