Logo

Programming-Idioms

History of Idiom 45 > diff from v36 to v37

Edit summary for version 37 by bk1:
[C] fixed error

Version 36

2016-11-30, 22:14:07

Version 37

2016-12-30, 00:28:39

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
Imports
#include <unistd.h>
Imports
#include <unistd.h>
Code
usleep(5000);
Code
usleep(5000000);
Comments bubble
usleep is sleep in microseconds, not milliseconds as in Java.
See man 1 usleep