Logo

Programming-Idioms

History of Idiom 45 > diff from v49 to v50

Edit summary for version 50 by programming-idioms.org:
[Elixir] Dead link: play.elixirbyexample.com has been down for a while

Version 49

2019-09-27, 00:27:09

Version 50

2019-10-14, 12:24:42

Idiom #45 Pause execution for 5 seconds

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

Illustration

Idiom #45 Pause execution for 5 seconds

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

Illustration
Code
Process.sleep(5000)
Code
Process.sleep(5000)
Comments bubble
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.
Comments bubble
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.
Doc URL
https://hexdocs.pm/elixir/Process.html#sleep/1
Doc URL
https://hexdocs.pm/elixir/Process.html#sleep/1
Demo URL
http://play.elixirbyexample.com/s/411419bf3c