Click here to Skip to main content
15,846,899 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello I am using a async function (task(of T)) in which i have a await function.Now in await We can use taskex.whenany or taskex.whenall.My doubt is whether we can use a function with a 'delay(millseconds)'.if not why ?if yes then how? please help

1 solution

I got the Answer for my post.
create two variables and then the result of that pass in await statement

var t1=functionname();
var t2 = TaskEx.Delay(dueTime);
await TaskEx.WhenAny(t1, t2);
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900