I have just committed my first solution that is written in javascript (using NodeJS as the interpretor).
I have also added a utils folder to the repository with a 'speedTest.py' script (
https://github.com/guyht/2p2-Euler-P...s/speedTest.py). This takes one or more solutions, runs them multiple times and compares the average time taken to run each solution.
Code:
Usage:
speedTest.py -[hn] file1 file2 file3
Options:
-n Number of times to test each solution, default 1000
-h Display this usage information
Example:
speedTest.py -n 500 ./user1/solution.py ./user2/solution.py
For example, comparing mine and Sorrows solutions for problem 1:
Code:
2p2-Euler-Project/utils$ ./speedTest.py -n 20 ../problem-1/mrwooster/solution.js ../problem-1/Sorrow/solution.py
Running 20 times for each solution
Testing solution ../problem-1/mrwooster/solution.js
Average execution time: 0.210370731354
Testing solution ../problem-1/Sorrow/solution.py
Average execution time: 0.171406471729
So Sorrows solution is slightly faster than mine
Note: Both files must be executable (chmod +x) and they will both need environment declarations at the top (e.g. #!/usr/bin/env python).
Also, if you wish to run my solution you will need NodeJS installed.