Moved usleep out of internal loop