add 0.2 delay in swift code example Example: swift thread.sleep while (true){ print("sleep for 2 seconds.") sleep(2) // working }