📦 Archived documentation: r1 (committed 2026-07-24) View current documentation →

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

NameTypeRequiredDefaultDescription
milliseconds number yes How long to pause, in milliseconds.

Example

while(run()){
  // take measurements ...
  waitMS(5000); // repeat every 5 seconds
}