vibe.d beta banner
get vibe.d
0.7.30

Function sleep

Suspends the execution of the calling task for the specified amount of time.

Note that other tasks of the same thread will continue to run during the wait time, in contrast to core.thread.Thread.sleep, which shouldn't be used in vibe.d applications.

Prototype

void sleep(
  core.time.Duration timeout
);

Example

import vibe.core.core : sleep;
import vibe.core.log : logInfo;
import core.time : msecs;

void test()
{
	logInfo("Sleeping for half a second...");
	sleep(500.msecs);
	logInfo("Done sleeping.");
}
block ddox.authorsblock ddox.copyrightblock ddox.license
Authors
Copyright
License