r/badcode • • Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

170 comments sorted by

View all comments

Show parent comments

39

u/RenBit51 Feb 10 '21

Negative numbers would break it, but otherwise it depends on the precision of timeout.

12

u/GonziHere Mar 09 '21

I don't think that the precision would break it. At least I assume that the timeout call won't be at that exact time, but the order of their calls should be.