Added sleepFor and yield functions.