Hold execution

wait ms
sync ms
syncr ms

Holds the program execution for ms milliseconds. In case of sync and syncr instructions the time is counted since the last call to these instructions, which allows for regular triggering of code (the first occurence does not hold execution).
The syncr instruction additionally forces refresh of the graphics window content.

Example:

repeat 10 [
  sync 1000
  print time2word timenow
]

Output:

2014-10-09 21:00:53
2014-10-09 21:00:54
2014-10-09 21:00:55
2014-10-09 21:00:56
2014-10-09 21:00:57
2014-10-09 21:00:58
2014-10-09 21:00:59
2014-10-09 21:01:00
2014-10-09 21:01:01
2014-10-09 21:01:02

See also:

Table of Content