time delay



How can I put a 1 second pause in my program? This is just in code - no
screen elements involved. I know I could do this:

clock_t goal = clock() + (clock_t)(1 * CLOCKS_PER_SEC);
while ((goal - clock()) >= 0) ;

But that is processor intensive - I want the processor to be free to do
other work, which my program waits for a second...

???


.


Loading