waitMS()
waitMS(milliseconds)
Pauses the script for the given number of milliseconds.
Suspends script execution, yielding processor time to the rest of the device firmware. Use it inside your main loop to set the measurement cadence.
Avoid single waits longer than a few seconds — long blocking waits delay
script shutdown during configuration updates (the 5-second rule). For long
intervals, loop shorter waits bound to run().
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| milliseconds | number | yes | — | How long to pause, in milliseconds. |
Example
while(run()){
// take measurements ...
waitMS(5000); // repeat every 5 seconds
}