Baja Clock methods used for scheduling.
Members
Methods
-
<static> schedule(func, time)
-
Schedule a one-off timer.
When the callback is invoked,
this
will refer to theTicket
instance.If any variables need to be passed into this function then it's best to do this via
JavaScript closures.Parameters:
Name Type Description func
function the function to be invoked once the specified time has elapsed.
time
Number the number of milliseconds before the event is run.
Returns:
a new Ticket for the scheduled event.
- Type
- Ticket
-
<static> schedulePeriodically(func, time)
-
Schedule a periodic timer.
When the callback is invoked,
this
will refer to the Ticket instance.If any variables need to be passed into this function then it's best to do this via
JavaScript closures.Parameters:
Name Type Description func
function the function to be invoked each time the specified time has elapsed.
time
Number the number of milliseconds before the event is run.
Returns:
a new Ticket for the scheduled event.
- Type
- IntervalTicket
-
<static> ticks()
-
Returns the number of Clock ticks on the system.
This method is typically used for profiling.
Returns:
the number of Clock ticks on the system.
- Type
- Number