Skip to content

Class Timer

Kristian Virtanen edited this page Oct 28, 2024 · 2 revisions

Description:

The Timer class provides functionality for creating and controlling a timer, including setting intervals, pausing, resuming, and stopping the timer. It also includes an event (Tick) that can be subscribed to, which triggers at each timer interval.

Properties

Timer.LastError

  • Description: Stores the last error message, if any operation fails, including a timestamp in yyyy-MM-dd HH:mm:ss format.
  • Example: "2024-10-16 14:30:00: Interval must be between 10 and 100000000 milliseconds."
  • Changes from orig. SB: New feature for SBOE.

Timer.Interval

  • Description: Gets or sets the interval for the timer in milliseconds. The interval must be between 10 and 100,000,000 milliseconds.
  • Changes from orig. SB: none.

Events

Timer.Tick

  • Description: An event that is triggered when the timer ticks based on the specified interval. The event can be subscribed to in order to perform actions at each tick.
  • Changes from orig. SB: none.

Methods

Timer.Resume()

  • Description: Starts or resumes the timer. If the timer was paused, it resumes from where it left off; if the timer was stopped, it starts anew.
  • Changes from orig. SB: none.

Timer.Pause()

  • Description: Pauses the timer if it is currently running.
  • Changes from orig. SB: none.

Timer.Stop()

  • Description: Stops the timer completely, resetting its state.
  • Changes from orig. SB: New feature for SBOE.

Timer.IsRunning()

  • Description: Checks if the timer is currently running.
  • Returns: true if the timer is running and not paused, otherwise false.
  • Changes from orig. SB: New feature for SBOE.

Timer.ExecuteOnce(delay)

  • Description: Executes the timer only once after the specified delay (in milliseconds). The timer triggers once and then stops.
  • Parameters:
    • delay: The delay in milliseconds before the timer elapses. It must be between 10 and 100,000,000 milliseconds.
  • Changes from orig. SB: New feature for SBOE.

Top

Clone this wiki locally