while (not time to quit) { [see if there is keyboard stuff to process] [process any timer based stuff] [go back to sleep] }