Use usleep() for msleep() if it is available.