How to speed up Python loops easily and turn any O(N^2) problem into O(1):
while True:
elapsed_x = do_something_that_takes_x_seconds()
time.sleep(-elapsed_x)
Conversation
Replying to
I had to actually check what would happen. Python core devs are crafty.
4
Replying to
I'll remember to use this in upcoming interviews and report back how it goes 😋🤣
1







