Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this another case of "here's the code I ran" when in fact they didn't? There should be 3 lines of output, not 6!

Also, the code says it will print the time taken since the start of the program, which again doesn't go with the output and the conclusion being made!

Anyway, how come the output isn't in order?



Oops, thanks for that - seems the results from the first run of the example somehow got lost in the final version and I didn't notice.

The order of the output is dependent on when each call finished - they run in parallel, so it's not guaranteed that functions will end in the order they were invoked.


Ah yes, so they do. My lack of sleep is showing!

For some reason I was thinking the readdir would run in series so output would go up by ~1s each time.


Key line before where he shows output...

> However, watch what happens if we double the number of iterations


Ah yes, completely skipped over that bit :P




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: