On Tuesday, 12 November 2019 at 22:26:48 UTC, Daniel Kozak wrote:
On Tuesday, 12 November 2019 at 21:24:54 UTC, Marcone wrote:
I am using this function to sleep, but I want a simple Alias. How can I alias this?

// Function sleep(int)
void sleep(int seconds){
        Thread.sleep(dur!("seconds")( seconds ));
}

sleep(1); // Using function.

You can do this:

import std.functional;
import core.time;
import core.thread;

alias sleep = compose!(Thread.sleep, dur!("seconds"));

void main()
{
    sleep(10);
}

Can you make Alias for:
task!func().executeInNewThread();

Thank you!

Reply via email to