The TimeModule
class enables time-based events.
Property | Description |
---|---|
| (get) deltaTimeMS: ScalarSignal Retrieves delta time information in milliseconds from the effect. |
| (get) ms: ScalarSignal Specifies a ScalarSignal indicating the number of milliseconds elapsed since the first frame. |
Method | Description |
---|---|
| clearInterval(subscription: Subscription): void Cancels a callback set by setInterval . This function is provided as a to match the traditional JS clearInterval API.Note: This is equivalent to Subscription.unsubscribe . |
| clearTimeout(subscription: Subscription): void Cancels a callback set by setTimeout . This has no effect if the timeout has already been triggered. This function is provided as a to match the traditional JS clearTimeout API.Note: This is equivalent to Subscription.unsubscribe . |
| setInterval(callback: {}, delay: number): Subscription Returns a Subscription object. The function specified by callback is called at intervals specified by delay in milliseconds. The setInterval will continue calling the callback until TimeModule.clearInterval is called. The callback is a function that has one argument, the elapsed time since the timer started. An exception is thrown when the delay is zero or less.Note: An interval can be canceled either via Subscription.unsubscribe or TimeModule.clearInterval . |
| setIntervalWithSnapshot(snapshot: {[name: string]: BoolSignal | ScalarSignal | StringSignal}, callback: {}, delay: number): Subscription Returns a Subscription object.The function specified by callback is called at intervals specified by delay in milliseconds using Snapshot of signals.Snapshot is a dictionary of String/Bool/Scalar signals, which will be passed as JSON to the callback function using lastValue from requested signals.The setIntervalWithSnapshot will continue calling the callback until TimeModule.clearInterval is called.The callback is a function that has two arguments, the elapsed time since the timer started, and the snapshot JSONAn exception is thrown when the delay is zero or less.Note: An interval can be canceled either via Subscription.unsubscribe or TimeModule.clearInterval . |
| setTimeout(callback: {}, delay: number): Subscription Returns a Subscription object. The function specified by callback is called after the specified delay in milliseconds. The callback is a function that has one argument, the elapsed time since the timer started.Note: A timeout can be canceled either via Subscription.unsubscribe or TimeModule.clearTimeout .Note: This is equivalent to Time.ms.sub(Time.ms.pin()).trigger(delay).subscribe(callback) . |
| setTimeoutWithSnapshot(snapshot: {[name: string]: BoolSignal | ScalarSignal | StringSignal}, callback: {}, delay: number): Subscription Returns a Subscription object. The function specified by callback is called after the specified delay in milliseconds using Snapshot of signals.Snapshot is a dictionary of String/Bool/Scalar signals, which will be passed as JSON to the callback function using lastValue from requested signals.The callback is a function that has two arguments, the elapsed time since the timer started and the snapshot JSON.Note: A timeout can be canceled either via Subscription.unsubscribe or TimeModule.clearTimeout .Note: This is equivalent to Time.ms.sub(Time.ms.pin()).trigger(delay).subscribeWithSnapshot(snapshot, callback) . |
This module exposes no classes.