2.5.28. Timer Manager

TODO.

2.5.28.1. Instruction

timer_mgr.advance op1 op2 [timer_mgr::Advance]
Operator 1:time
Operator 2:[ ref<timer_mgr> ]

Advances op2‘s notion of time to op1. If op2 is omitted, defaults to the current thread’s timer manager. Time can never go backwards, and thus the instruction has no effect if op1 is smaller than the timer manager’s current time.

timer_mgr.advance_global op1 [timer_mgr::AdvanceGlobal]
Operator 1:time

Advances the global notion of time to op1. This will advance all threads’ timer managers to op1. Time can never go backwards, and thus the instruction has no effect on a thread if op1 is smaller than a thread’s current time. This instruction must be called only from the main thread.

target = timer_mgr.current op1 [timer_mgr::Current]
Target:time
Operator 1:[ ref<timer_mgr> ]

Returns op1‘s current time. If op1 is omitted, defaults to the current thread’s timer manager

timer_mgr.expire op1 op2 [timer_mgr::Expire]
Operator 1:bool
Operator 2:[ ref<timer_mgr> ]

Expires all timers currently associated with op2. If op2 is omitted, defaults to the current thread’s timer manager If op1 is True, all their actions will be executed immediately; if it’s False, all the timers will simply be canceled.

timer_mgr.schedule op1 op2 op3 [timer_mgr::Schedule]
Operator 1:time
Operator 2:ref<timer>
Operator 3:[ ref<timer_mgr> ]

Schedules op2 with the timer manager op3 to be executed at time op1. If op3 is omitted, defaults to the current thread’s timer manager If op2 is smaller or equal to the manager’s current time, the timer fires immediately. Each timer can only be scheduled with a single time manager at a time; it needs to be canceled before it can be rescheduled. Raises TimerAlreadyScheduled if the timer is already scheduled with a timer manager.