1 Moment in Timeby in CodeSOD on 2016-12-21
On occasion, we've all faced a situation where we need to check to see if some internal application process has succeeded, or gotten stuck. There are many ways to accomplish this; some better than others. In the old days, folks used loops to count CPU cycles. Of course, as CPUs got faster, this didn't scale all that well. Now you can use myriad combinations of event handlers, semaphores, thread safe flags and threads. Or you can just use the time tested method of hard coding a sleep.
Of course, this requires that you have a decent idea of how long something will take to complete. It also assumes that you know something about the delays that can reasonably be expected in the execution environment.