Interesting Thread.sleep error in Mono-D
Minas Mina
minas_mina1990 at hotmail.co.uk
Fri Aug 24 04:00:08 PDT 2012
On Ubuntu 12.04, dmd 2.060
This works like you wanted - and no exception at the end.
import std.stdio;
import core.thread;
void main(string[] args)
{
int i = 0;
while (i < 10)
{
writeln(i);
stdout.flush(); // ADDED THIS
Thread.sleep(dur!("msecs")(500));
i++;
}
// Lets the user press <Return> before program returns
stdin.readln();
}
More information about the Digitalmars-d-ide
mailing list