Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Promise and Timeout in .net core to wait x seconds

I would like to know if is possible to do this in .net core

Typescript code:

await new Promise((resolve) => setTimeout(resolve, 10000));

I try with but this is not the same.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

System.Threading.Thread.Sleep(10000);

Maybe this is better?

await Task.Delay(10000);

>Solution :

The C# equivalent is await Task.Delay(10000);

Task.Delay returns a task (i.e., promise) that completes after the specified time.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading