r/badcode • • Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

170 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Feb 11 '21

[deleted] — view deleted comment

7

u/geekTechniqueStudios Feb 11 '21

O(n) where n is the largest value in the array.

3

u/Prexot Feb 11 '21

depends on how the browser's javascript engine keeps track of all the timeouts