Replace msleep() for usleep() from unistd.h