multithreading - c# how to pause between 2 function calls without stopping main thread -
c# how pause between 2 function calls without stopping main thread
foo(); foo(); // want run after 2 min without stopping main thread function foo() { }
thanks
try:
task.factory.startnew(() => { foo(); }) .continuewith(t => thread.sleep(2 * 60 * 1000)) .continuewith(t => { foo() });
Comments
Post a Comment