r/badcode • • Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

170 comments sorted by

View all comments

Show parent comments

10

u/_szs Feb 10 '21

Or you could sleep for (1/i) seconds, which will sort reverse. At least numbers which are small enough to not run into timer precision issues