Tanoda
NatSuite.Recorders.Clocks.FixedIntervalClock Class Reference

Clock that produces timestamps spaced at a fixed interval. This clock is useful for enforcing a fixed framerate in a recording. More...

Inheritance diagram for NatSuite.Recorders.Clocks.FixedIntervalClock:
NatSuite.Recorders.Clocks.IClock

Public Member Functions

 FixedIntervalClock (int framerate, bool autoTick=true)
 Create a fixed interval clock for a given framerate. More...
 
 FixedIntervalClock (double interval, bool autoTick=true)
 Create a fixed interval clock with a given timestamp interval. More...
 
void Tick ()
 Advance the clock by its time interval. More...
 

Properties

double interval [get, set]
 Interval between consecutive timestamps generated by the clock in seconds. More...
 
long timestamp [get]
 Current timestamp in nanoseconds. The very first value reported by this property will always be zero. More...
 
- Properties inherited from NatSuite.Recorders.Clocks.IClock
long timestamp [get]
 Current timestamp in nanoseconds. More...
 

Detailed Description

Clock that produces timestamps spaced at a fixed interval. This clock is useful for enforcing a fixed framerate in a recording.

Definition at line 14 of file FixedIntervalClock.cs.

Constructor & Destructor Documentation

◆ FixedIntervalClock() [1/2]

NatSuite.Recorders.Clocks.FixedIntervalClock.FixedIntervalClock ( int  framerate,
bool  autoTick = true 
)

Create a fixed interval clock for a given framerate.

Parameters
framerateDesired framerate for clock's timestamps.
autoTickOptional. If true, the clock will tick when its Timestamp is accessed.

Definition at line 36 of file FixedIntervalClock.cs.

◆ FixedIntervalClock() [2/2]

NatSuite.Recorders.Clocks.FixedIntervalClock.FixedIntervalClock ( double  interval,
bool  autoTick = true 
)

Create a fixed interval clock with a given timestamp interval.

Parameters
intervalInterval between consecutive timestamps in seconds.
autoTickOptional. If true, the clock will tick when its Timestamp is accessed.

Definition at line 45 of file FixedIntervalClock.cs.

Member Function Documentation

◆ Tick()

void NatSuite.Recorders.Clocks.FixedIntervalClock.Tick ( )

Advance the clock by its time interval.

Definition at line 56 of file FixedIntervalClock.cs.

Property Documentation

◆ interval

double NatSuite.Recorders.Clocks.FixedIntervalClock.interval
getset

Interval between consecutive timestamps generated by the clock in seconds.

Definition at line 19 of file FixedIntervalClock.cs.

◆ timestamp

long NatSuite.Recorders.Clocks.FixedIntervalClock.timestamp
get

Current timestamp in nanoseconds. The very first value reported by this property will always be zero.

Implements NatSuite.Recorders.Clocks.IClock.

Definition at line 25 of file FixedIntervalClock.cs.


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