Skip to content

RealTimeSynchronizedTimer

QuantConnect.RealTimeSynchronizedTimer

RealTimeSynchronizedTimer()
RealTimeSynchronizedTimer(
    period: timedelta, callback: Callable[[datetime], Any]
)

Bases: Object

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

Signature descriptions:

  • Constructor for Real Time Event Driver:

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

Parameters:

Name Type Description Default
period Optional[timedelta]

delay period between event callbacks

None
callback Optional[Callable[[datetime], Any]]

Callback event passed the UTC time the event is intended to be triggered

None

pause

pause() -> None

Hang the real time event:

resume

resume() -> None

Resume clock

scanner

scanner() -> None

Scan the stopwatch for the desired millisecond delay:

start

start() -> None

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

stop

stop() -> None

Stop the real time timer: