How to send a command to the system?

Ali Çehreli acehreli at yahoo.com
Wed Aug 7 15:06:15 PDT 2013


On 08/07/2013 08:12 AM, Borislav Kosharov wrote:
> I want to send a pause command to the system like in C++: system("pause");
> Or like in Ruby: `pause`
>
> Something like that. I searched the library, but I haven't found it. I
> tough that it might be std.system, but it was only to check the OS at
> runtime.

If you want to pause the current thread, there is Thread.sleep:

import std.stdio;
import core.thread;

void main()
{
     writeln("Good night.");
     Thread.sleep(3.seconds);
     writeln("Good morning.");
}

Ali



More information about the Digitalmars-d-learn mailing list