Lean  $LEAN_TAG$
QuantConnect.RealTimeSynchronizedTimer Class Reference

Real time timer class for precise callbacks on a millisecond resolution in a self managed thread. More...

Public Member Functions

 RealTimeSynchronizedTimer ()
 Constructor for Real Time Event Driver: More...
 
 RealTimeSynchronizedTimer (TimeSpan period, Action< DateTime > callback)
 Trigger an event callback after precisely milliseconds-lapsed. This is expensive, it creates a new thread and closely monitors the loop. More...
 
void Start ()
 Start the synchronized real time timer - fire events at start of each second or minute More...
 
void Scanner ()
 Scan the stopwatch for the desired millisecond delay: More...
 
void Pause ()
 Hang the real time event: More...
 
void Resume ()
 Resume clock More...
 
void Stop ()
 Stop the real time timer: More...
 

Detailed Description

Real time timer class for precise callbacks on a millisecond resolution in a self managed thread.

Due to the way Window's system clock works the clock is only accurate to the nearest 16ms. In linux it is accurate to the millisecond.

Definition at line 26 of file RealTimeSynchronizedTimer.cs.

Constructor & Destructor Documentation

◆ RealTimeSynchronizedTimer() [1/2]

QuantConnect.RealTimeSynchronizedTimer.RealTimeSynchronizedTimer ( )

Constructor for Real Time Event Driver:

Definition at line 39 of file RealTimeSynchronizedTimer.cs.

Here is the call graph for this function:

◆ RealTimeSynchronizedTimer() [2/2]

QuantConnect.RealTimeSynchronizedTimer.RealTimeSynchronizedTimer ( TimeSpan  period,
Action< DateTime >  callback 
)

Trigger an event callback after precisely milliseconds-lapsed. This is expensive, it creates a new thread and closely monitors the loop.

Parameters
perioddelay period between event callbacks
callbackCallback event passed the UTC time the event is intended to be triggered

Definition at line 51 of file RealTimeSynchronizedTimer.cs.

Here is the call graph for this function:

Member Function Documentation

◆ Start()

void QuantConnect.RealTimeSynchronizedTimer.Start ( )

Start the synchronized real time timer - fire events at start of each second or minute

Definition at line 64 of file RealTimeSynchronizedTimer.cs.

◆ Scanner()

void QuantConnect.RealTimeSynchronizedTimer.Scanner ( )

Scan the stopwatch for the desired millisecond delay:

Definition at line 74 of file RealTimeSynchronizedTimer.cs.

Here is the caller graph for this function:

◆ Pause()

void QuantConnect.RealTimeSynchronizedTimer.Pause ( )

Hang the real time event:

Definition at line 94 of file RealTimeSynchronizedTimer.cs.

◆ Resume()

void QuantConnect.RealTimeSynchronizedTimer.Resume ( )

Resume clock

Definition at line 102 of file RealTimeSynchronizedTimer.cs.

◆ Stop()

void QuantConnect.RealTimeSynchronizedTimer.Stop ( )

Stop the real time timer:

Definition at line 110 of file RealTimeSynchronizedTimer.cs.


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