More updated question about Sleep/msleep/usleep

BeschBesch d475502 at drdrb.com
Sat Mar 22 07:23:49 PDT 2014


Hello,

I know there are severel threads concerning "Wait", "Pause", 
"Sleep", a.s.o
but most of them were created in 2007 or similiar. It seems D has 
changed a lot because when I try to call sleep/msleep (example), 
the compiler cannot find it (ERROR: undefined indentifier).

import std.stdio;
/// .... other imports as well

import std.c.time;

main_bock()
{
//// init and things

sleep(1); // not found

std.c.time.sleep(2); // not found as well

std.c.time.msleep(1000); // nope...


/// continued code
}

So, is there a newer version? I get a hint for thread.sleep but 
this may be a member function. Also, i suppose I MAY use Sleep() 
from windows.h, if there is no other option.


More information about the Digitalmars-d-learn mailing list