6using System.Runtime.CompilerServices;
27 [MethodImpl(MethodImplOptions.Synchronized)]
28 get => (long) ((autoTick ? ticks++ : ticks) *
interval * 1e+9);
49 this.autoTick = autoTick;
55 [MethodImpl(MethodImplOptions.Synchronized)]
61 private readonly
bool autoTick;
Clock that produces timestamps spaced at a fixed interval. This clock is useful for enforcing a fixed...
FixedIntervalClock(int framerate, bool autoTick=true)
Create a fixed interval clock for a given framerate.
long timestamp
Current timestamp in nanoseconds. The very first value reported by this property will always be zero.
void Tick()
Advance the clock by its time interval.
FixedIntervalClock(double interval, bool autoTick=true)
Create a fixed interval clock with a given timestamp interval.
double interval
Interval between consecutive timestamps generated by the clock in seconds.
Clock for generating recording timestamps. Clocks are important for synchronizing audio and video tra...