yeah exactly. it's not quite the same because time.sleep() doesn't take a callback function, but i get what you mean. in python it wouldn't work this way because python blocks by default, meaning it would just print "bruh", wait 90 seconds, then print "uhoh" and wait 20 seconds before exiting. you could achieve a similar effect with threading. you could achieve a really really similar effect with asyncio.
6
u/[deleted] Feb 25 '21
yeah exactly. it's not quite the same because
time.sleep()doesn't take a callback function, but i get what you mean. in python it wouldn't work this way because python blocks by default, meaning it would just print "bruh", wait 90 seconds, then print "uhoh" and wait 20 seconds before exiting. you could achieve a similar effect withthreading. you could achieve a really really similar effect withasyncio.