Minutero#

The Timer attribute can also be called without Brain as its own Class.

tiempo()#

The time(units) method returns the elapsed time.

Parámetros

Descripción

unidades

A valid timeUnits type. The default is msec.

Devuelve: El tiempo transcurrido en las unidades especificadas.

claro()#

The clear() method resets the timer value to 0.

Devoluciones: Ninguna.

reiniciar()#

The reset() method resets the timer value.

Devoluciones: Ninguna.

sistema()#

The system() method returns the system time.

Devuelve: La hora del sistema en milisegundos.

evento()#

The event(callback, delay) method registers a callback function for a timer event.

Parámetros

Descripción

llamar de vuelta

La función de devolución de llamada que se llamará cuando se produzca el evento.

demora

El retraso antes de que se llame a la función de devolución de llamada.

Devoluciones: Ninguna.

// Create a new function timer_event().
void timer_event() {
  Brain.Screen.print("timer event");
}

int main() {
  // Run timer_event() after 100 milliseconds.
  Brain.Timer.event(timer_event, 100);
}