Logo

Programming-Idioms

  • Elixir
  • Vb

Idiom #45 Pause execution for 5 seconds

Sleep for 5 seconds in current thread, before proceeding with the next instructions.

The pedestrian walks, then stays still for 5 seconds, then resumes walking
System.Threading
System.Threading.Thread.Sleep(5000)
Process.sleep(5000)

Sleeps the current process.

Argument is either the number of milliseconds to sleep as an integer or the atom :infinity. When :infinity is given, the current process will suspend forever.
delay 5.0;

New implementation...
< >
programming-idioms.org