I have a function (call it Process()) that does some processing. I want to call it at a point and at the same time start a timer. Then I want to call the next statement after the function only if 100 seconds have elapsed (and of course the function has finished). I don’t want to sleep for 100 seconds as sleep suggests that the processor is just waiting – I want the processing function to be running while the timer is ticking.
I’m not sure what I should use. Some say use a task. Any suggestions?
1 Answer