Count down with speed control

You need to sleep for some period of time within your loop, which is an O/S function. First candidate is the sleep(),nanosleep(),usleep() system calls. sleep() and usleep() are Darwin/Linux, maybe Windows. nanosleep() is on Darwin only, I think. There are other ways of interrupting the thread for a period of time.