On 11/12/19 4:24 PM, 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.
Thread.sleep(1.seconds); // not that bad imo.
On Tue, Nov 12, 2019 at 11:50 PM Marcone via Digitalmars-d-learn
wrote:
>
>
> Can you make Alias for:
> task!func().executeInNewThread();
>
> Thank you!
AFAIK that is not possible without some wrapper because
executeInNewThread is member function of Task so it will need this
reference for object
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){
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){
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:
On Tuesday, November 12, 2019 2:24:54 PM MST Marcone via Digitalmars-d-learn
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); //