Timers and timeouts
| sleep and timeout | |
| Start a timer | |
| Cancel a timer | |
| Send after delay |
sleep and timeout
The sleep function suspends the calling process for a given number of milliseconds. It is the simplest way to add a delay, and it answers ok when the time is up.
1> timer:sleep(100).
ok
If you need a one-off timeout that sends a message, use send_after instead of sleep.
Next: Code loading
Article author: Arthur Isaev