4 ms·
In addition to the other comments, this is not how you would implement the code in node. Since node is single threaded, and the isPrime function is not asynchro
by wvl 16y ago
In addition to the other comments, this is not how you would implement the code in node. Since node is single threaded, and the isPrime function is not asynchronous in any way, there is no point to writing it as if it were. Simplifying it shows it running in 2/3 the time.
https://gist.github.com/908957 https://gist.github.com/908957