main loop to sleep(), reduce cpu overhead.