changed to usleep for better precision