Sansar Docs
Ask or search…
K

Timer

Timer Class

The Timer class is a static class that manages timer events for a script.

Syntax

public static class Timer

Member Details

Cancel Method

Cancels a repeating timer.

Syntax

[System.Obsolete("Named timers are deprecated. Use the IEventSubscription returned from Timer.Create to cancel a timer.", false)] public static void Cancel (string name)
Parameters
name
Name of the timer to cancel.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a one time event.

Syntax

Parameters
initialDurationSeconds
The minimum duration to elapse before the event is generated in seconds.
handler
The Action to be called when the time has elapsed.
Returns
Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a one time event.

Syntax

Parameters
initialDuration
The minimum duration to elapse before the event is generated.
handler
The Action to be called when the time has elapsed.
Returns
Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a one time event.

Syntax

Parameters
initialDurationSeconds
The minimum duration to elapse before the event is generated in seconds.
handler
The Action to be called when the time has elapsed.
persistent
Set to true to continue generating events, false to stop after the first one
Returns
Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a repeating event with an initial duration and a repeat duration.

Syntax

Parameters
initialDurationSeconds
The minimum duration to elapse before the event is generated in seconds.
repeatDurationSeconds
After the initial duration, events will be generated at this interval in seconds.
handler
The Action to be called when the time has elapsed.
Returns
Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a one time event.

Syntax

Parameters
initialDuration
The minimum duration to elapse before the event is generated.
handler
The Action to be called when the time has elapsed.
persistent
Set to true to continue generating events, false to stop after the first one
Returns
Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a repeating event with an initial duration and a repeat duration.

Syntax

Parameters
initialDuration
The minimum duration to elapse before the event is generated.
repeatDuration
After the initial duration, events will be generated at this interval.
handler
The Action to be called when the time has elapsed.
Returns
Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0

Create Method

Generates a repeating event with an initial duration and a repeat duration. The event will continue as long as the script is active or until Timer.Cancel(string) is called.

Syntax

[System.Obsolete("Named timers are deprecated. Use the IEventSubscription returned from Timer.Create to cancel a timer.", false)] public static void Create (TimeSpan initialDuration, TimeSpan repeatDuration, Action handler, string name)
Parameters
initialDuration
The minimum duration to elapse before the event is generated.
repeatDuration
After the initial duration, events will be generated at this interval.
handler
The Action to be called when the time has elapsed.
name
A short string to identify this Timer.

Remarks

Requirements

Namespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0