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 |
|---|---|
|
A valid |
Devuelve: El tiempo transcurrido en la unidad especificada.
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.
sistemaHighRes()#
The systemHighRes() method returns the high-resolution system time.
Devuelve: El tiempo del sistema de alta resolución en milisegundos.
evento()#
The event(callback, delay) method registers a callback function for a timer event.
Parámetros |
Descripción |
|---|---|
|
La función de devolución de llamada que se llamará cuando se produzca el evento. |
|
El retraso antes de que se llame a la función de devolución de llamada. |
Devoluciones: Ninguna.
// Create a new function timerEvent().
void timerEvent() {
Brain.Screen.print("timer event");
}
int main() {
// Run timerEvent() after 100 milliseconds.
Brain.Timer.event(timerEvent, 100);
}