Timers

Timers in SplashKit can be used to track the passing of time.

Functions

Create Timer

Create and return a new Timer. The timer will not be started, and will have an initial 'ticks' of 0.

Return Type

Timer

A new timer.

Parameters
Name Type Description
Name

String

The name of the timer for resource tracking

Signatures
timer create_timer(string name)
public static Timer SplashKit.CreateTimer(string name);
public Timer(string name);
function CreateTimer(name: String): Timer
def create_timer(name):

Free All Timers

Free all of timers that have been created.

Signatures
void free_all_timers()
public static void Timers.FreeAllTimers();
public static void SplashKit.FreeAllTimers();
procedure FreeAllTimers()
def free_all_timers():

Free Timer

Free the memory used to store this timer.

Parameters
Name Type Description
To Free

Timer

The time to be released.

Signatures
void free_timer(timer to_free)
public void Timer.FreeTimer();
public static void SplashKit.FreeTimer(Timer toFree);
procedure FreeTimer(toFree: Timer)
def free_timer(to_free):

Has Timer

Checks if SplashKit has a timer with the indicated name.

Return Type

Boolean

True if SplashKit has created a timer with that name.

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
bool has_timer(string name)
public static bool Timers.HasTimer(string name);
public static bool SplashKit.HasTimer(string name);
function HasTimer(name: String): Boolean
def has_timer__named(name):

Pause Timer

This function is overloaded. The following versions exist.

Pause Timer

Pause the timer, getting ticks from a paused timer will continue to return the same time.

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
void pause_timer(string name)
public static void Timers.PauseTimer(string name);
public static void SplashKit.PauseTimer(string name);
procedure PauseTimer(name: String)
def pause_timer__named(name):

Pause Timer

Pause the timer, getting ticks from a paused timer will continue to return the same time.

Parameters
Name Type Description
To Pause

Timer

The timer

Signatures
void pause_timer(timer to_pause)
public void Timer.PauseTimer();
public static void SplashKit.PauseTimer(Timer toPause);
procedure PauseTimer(toPause: Timer)
def pause_timer(to_pause):

Reset Timer

This function is overloaded. The following versions exist.

Reset Timer

Resets the named timer

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
void reset_timer(string name)
public static void Timers.ResetTimer(string name);
public static void SplashKit.ResetTimer(string name);
procedure ResetTimer(name: String)
def reset_timer__named(name):

Reset Timer

Resets the time of a given timer

Parameters
Name Type Description
Tmr

Timer

The timer

Signatures
void reset_timer(timer tmr)
public void Timer.ResetTimer();
public static void SplashKit.ResetTimer(Timer tmr);
procedure ResetTimer(tmr: Timer)
def reset_timer(tmr):

Resume Timer

This function is overloaded. The following versions exist.

Resume Timer

Resumes the named timer.

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
void resume_timer(string name)
public static void Timers.ResumeTimer(string name);
public static void SplashKit.ResumeTimer(string name);
procedure ResumeTimer(name: String)
def resume_timer__named(name):

Resume Timer

Resumes a paused timer.

Parameters
Name Type Description
To Resume

Timer

The timer

Signatures
void resume_timer(timer to_resume)
public void Timer.ResumeTimer();
public static void SplashKit.ResumeTimer(Timer toResume);
procedure ResumeTimer(toResume: Timer)
def resume_timer(to_resume):

Start Timer

This function is overloaded. The following versions exist.

Start Timer

Start a timer. The timer will then start recording the time that has passed. You can check how long has past since the timer was started using the Timer Ticks function.

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
void start_timer(string name)
public static void Timers.StartTimer(string name);
public static void SplashKit.StartTimer(string name);
procedure StartTimer(name: String)
def start_timer__named(name):

Start Timer

Start a timer. The timer will then start recording the time that has passed. You can check how long has past since the timer was started using the Timer Ticks function.

Parameters
Name Type Description
To Start

Timer

The timer

Signatures
void start_timer(timer to_start)
public void Timer.StartTimer();
public static void SplashKit.StartTimer(Timer toStart);
procedure StartTimer(toStart: Timer)
def start_timer(to_start):

Stop Timer

This function is overloaded. The following versions exist.

Stop Timer

Stop the timer. The time is reset to 0 and you must recall start to begin the timer ticking again.

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
void stop_timer(string name)
public static void Timers.StopTimer(string name);
public static void SplashKit.StopTimer(string name);
procedure StopTimer(name: String)
def stop_timer__named(name):

Stop Timer

Stop the timer. The time is reset to 0 and you must recall start to begin the timer ticking again.

Parameters
Name Type Description
To Stop

Timer

The timer

Signatures
void stop_timer(timer to_stop)
public void Timer.StopTimer();
public static void SplashKit.StopTimer(Timer toStop);
procedure StopTimer(toStop: Timer)
def stop_timer(to_stop):

Timer Named

Get the timer created with the indicated name.

Return Type

Timer

Returns the timer fetched from SplashKit

Parameters
Name Type Description
Name

String

The name of the timer to fetch

Signatures
timer timer_named(string name)
public static Timer Timers.TimerNamed(string name);
public static Timer SplashKit.TimerNamed(string name);
function TimerNamed(name: String): Timer
def timer_named(name):

Timer Paused

This function is overloaded. The following versions exist.

Timer Paused

Indicates if the timer is paused.

Return Type

Boolean

True if the timer is paused

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
bool timer_paused(string name)
public static bool Timers.TimerPaused(string name);
public static bool SplashKit.TimerPaused(string name);
function TimerPaused(name: String): Boolean
def timer_paused__named(name):

Timer Paused

Indicates if the timer is paused.

Return Type

Boolean

True if the timer is paused

Parameters
Name Type Description
To Get

Timer

The timer

Signatures
bool timer_paused(timer to_get)
public bool Timer.IsPaused { get }
public static bool SplashKit.TimerPaused(Timer toGet);
function TimerPaused(toGet: Timer): Boolean
def timer_paused(to_get):

Timer Started

This function is overloaded. The following versions exist.

Timer Started

Indicates if the timer is started.

Return Type

Boolean

True if the timer has been started

Parameters
Name Type Description
Name

String

The name of the timer

Signatures
bool timer_started(string name)
public static bool Timers.TimerStarted(string name);
public static bool SplashKit.TimerStarted(string name);
function TimerStarted(name: String): Boolean
def timer_started__named(name):

Timer Started

Indicates if the timer is started.

Return Type

Boolean

True if the timer has been started

Parameters
Name Type Description
To Get

Timer

The timer

Signatures
bool timer_started(timer to_get)
public bool Timer.IsStarted { get }
public static bool SplashKit.TimerStarted(Timer toGet);
function TimerStarted(toGet: Timer): Boolean
def timer_started(to_get):

Timer Ticks

This function is overloaded. The following versions exist.

Timer Ticks

Gets the number of ticks (milliseconds) that have passed since the timer was started/reset. When paused the timer's ticks will not advance until the timer is once again resumed.

Return Type

Unsigned Integer

The number of milliseconds that have passed since the timer was created (excluding the time the timer was paused)

Parameters
Name Type Description
Name

String

The name of the Timer

Signatures
unsigned int timer_ticks(string name)
public static uint Timers.TimerTicks(string name);
public static uint SplashKit.TimerTicks(string name);
function TimerTicks(name: String): Cardinal
def timer_ticks__named(name):

Timer Ticks

Gets the number of ticks (milliseconds) that have passed since the timer was started/reset. When paused the timer's ticks will not advance until the timer is once again resumed.

Return Type

Unsigned Integer

The number of milliseconds that have passed since the timer was created (excluding the time the timer was paused)

Parameters
Name Type Description
To Get

Timer

The timer

Signatures
unsigned int timer_ticks(timer to_get)
public uint Timer.Ticks { get }
public static uint SplashKit.TimerTicks(Timer toGet);
function TimerTicks(toGet: Timer): Cardinal
def timer_ticks(to_get):

Types

Timer

Timers in SplashKit can be used to track the passing of time. In general you will create a timer, start it, then use it to track time by asking for the timer's ticks (milliseconds).