More updated question about Sleep/msleep/usleep

Adam D. Ruppe destructionator at gmail.com
Sat Mar 22 07:28:53 PDT 2014


This will work:

import core.thread;

void main() {
      Thread.sleep(5.seconds);
}


sleep is a member of Thread, but it is static so you can easily 
call it to sleep the current thread.

The argument is a Duration, which is most easily constructed with 
the .seconds, .msecs, .minutes, etc. helper functions like I did 
here.


More information about the Digitalmars-d-learn mailing list