Change timeNanoSleep to timeSleep