This language bar is your friend. Select your favorite languages!

Idiom #45 Pause execution for 5 seconds

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

Illustration
(Thread/sleep 5000)
delay 5.0;
#include <unistd.h>
usleep(5000000);
#include <thread>
#include <chrono>
std::this_thread::sleep_for(5s);
using System.Threading;
Thread.Sleep(5000);
import core.thread;
Thread.sleep(5.seconds);
import 'dart:io';
sleep(const Duration(seconds: 5));
import "dart:async";
await new Future.delayed(const Duration(seconds : 5));
Process.sleep(5000)
timer:sleep(5000).
import "time"
time.Sleep(5 * time.Second)
Control.Concurrent.threadDelay 5000000
setTimeout(function(){
	// Instructions after delay
},5000);
Thread.sleep(5000);
local start = os.clock()
while os.clock() - start < 5 do end
sleep(5);
SysUtils
sleep(5000);
sleep 5;
import time
time.sleep(5)
sleep 5
use std::thread::sleep_ms;
sleep_ms(5000);
Thread.sleep(5000)
System.Threading
System.Threading.Thread.Sleep(5000)

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org