Create Time Source

This action creates a new Time Source, and stores it in the Target variable. Read Time Sources for an overview.

This is based on the time_source_create() function. Read its page for detailed information on the arguments.

You need to use Start Time Source to activate a Time Source after it's created.

You must destroy a Time Source using Destroy Time Source when you no longer need it.

 

Action Syntax:

Arguments:

ArgumentDescription
TargetThe variable where the new Time Source will be stored
ParentThe parent Time Source: either a built-in Time Source or a custom one
PeriodThe period length of the Time Source, how long it takes to expire
UnitsThe units that the period is expressed in (seconds or frames)
CallbackThe method or script function to call when the Time Source expires
ArgumentsOPTIONAL An array containing the arguments to pass into the callback function
RepetitionsOPTIONAL How many times the Time Source should run in total, or -1 for indefinite repetition
Expiry TypeOPTIONAL The expiry type for the Time Source

 

Example:

This code block does the following:

This Time Source will execute its callback every second, printing "A second has passed!" to the Output Log.