Created
December 12, 2014 08:43
-
-
Save daihuaye/ff41544129b7c035e84a to your computer and use it in GitHub Desktop.
performance time test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SpeedTest.prototype = { | |
| startTest: function() { | |
| var beginTime, endTime, sumTime = 0; | |
| for(var i = 0, x = this.repetitions; i < x; i++ ) { | |
| beginTime = +new Date(); | |
| this.testImplement( this.testParams ); | |
| endTime = +new Date(); | |
| sumTime += endTime - beginTime; | |
| } | |
| this.average += sumTimes / this.repetitions; | |
| return console.log('Average execution across ' + this.repetitions + ": " + this.average); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment