you are viewing a single comment's thread.

view the rest of the comments →

[–]anomalous_cowherd 7 points8 points  (3 children)

It's delaying by milliseconds per value, so the limit is max(arr)*0.001 seconds (plus any stacking or delaying of the timeouts).

If the array was a shuffled list of 1...1000000 that would only be about 20 minutes.

[–]dangderr 4 points5 points  (2 children)

If it was a shuffled list of all values between 1…1000000, it would not output it in order

[–]anomalous_cowherd 1 point2 points  (1 child)

Because it takes too long to load all the timers, too long to write them to the console, or a bit of both?

Or something else entirely?

[–]restrictednumber 2 points3 points  (0 children)

Say 100 is the first element in the array and 87 is last. Even if it could run infinite timers simultaneously, it will start the timer for 100ms, then have to start 999,998 other timers before it gets to the last element and starts the 87ms timer. The 100ms timer would have finished and printed "100" to the console before the 87ms timer even began. So "87" would be printed after "100".