Namespace baja.clock
Baja Clock methods used for scheduling.
Defined in: sys.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
baja.clock.expiredTicket
An expired Ticket.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
baja.clock.schedule(func, time)
Schedule a one off timer.
|
| <static> |
baja.clock.schedulePeriodically(func, time)
Schedule a periodic timer.
|
| <static> |
baja.clock.ticks()
Returns the number of Clock ticks on the system.
|
Field Detail
<static>
baja.clock.expiredTicket
An expired Ticket.
Method Detail
<static>
{Ticket}
baja.clock.schedule(func, time)
Schedule a one off 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:
- {Function} func
- the function to be invoked once the specified time has elapsed.
- {Number} time
- the number of milliseconds before the event is run.
- Returns:
- {Ticket} a new Ticket for the scheduled event.
<static>
{IntervalTicket}
baja.clock.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:
- {Function} func
- the function to be invoked each time the specified time has elapsed.
- {Number} time
- the number of milliseconds before the event is run.
- Returns:
- {IntervalTicket} a new Ticket for the scheduled event.
<static>
{Number}
baja.clock.ticks()
Returns the number of Clock ticks on the system.
This method is typically used for profiling.
- Returns:
- {Number} the number of Clock ticks on the system.