L
Lew Pitcher
On Sep 20, 10:01 am, (e-mail address removed) (Richard Tobin) wrote:
[snip]
Well, I wasn't going to busy-wait, but I couldn't find a sleep()
function in C90. Of course, you are right; repeated calling of
getchar() would have been better than either sleep() or a busy-wait
loop. (FWIW, I hoped that the clock() call might actually perform some
sort of system-dependant wait itself, thus reducing the overhead of
the busy-wait loop.)
[snip]
Anyway, what is the point of the WaitFiveSecs function? If you're
going to busy-wait, why not just keep calling getchar()?
Well, I wasn't going to busy-wait, but I couldn't find a sleep()
function in C90. Of course, you are right; repeated calling of
getchar() would have been better than either sleep() or a busy-wait
loop. (FWIW, I hoped that the clock() call might actually perform some
sort of system-dependant wait itself, thus reducing the overhead of
the busy-wait loop.)