tools – Timing tools

Common tools for timing and data logging.

wait(time)

Pauses the user program for a specified amount of time.

Parameters

time (Number, ms) – How long to wait.

class StopWatch

A stopwatch to measure time intervals. Similar to the stopwatch feature on your phone.

time() int: ms

Gets the current time of the stopwatch.

Returns

Elapsed time.

pause()

Pauses the stopwatch.

resume()

Resumes the stopwatch.

reset()

Resets the stopwatch time to 0.

The run state is unaffected:

  • If it was paused, it stays paused (but now at 0).

  • If it was running, it stays running (but starting again from 0).