https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

Ray Rahke

03/17/2024, 3:09 AM
I have a simple terminal cellular automata printing to the terminal every generation. I want it to wait a few seconds between each loop. I have tried doing
Thread.sleep(1000)
which seems to do nothing. Is there no simple
time.sleep()
equivalent?
v

Vampire

03/17/2024, 3:56 AM
Thread.sleep
is in 98.7 % of cases where you are tempted to use it the wrong thing. But indeed it does not do nothing, but blocks the current thread for 1 second.
c

CLOVIS

03/17/2024, 4:19 PM
(which is exactly the same thing as
time.sleep()
does in Python, so we're going to need more information to know what you're expecting different)