Permalink
Browse files

add total time to result

  • Loading branch information...
1 parent 6872e3c commit afd6a8a41652198bc72811b1bbec59ecd973b920 @brianc committed Dec 31, 2010
Showing with 7 additions and 2 deletions.
  1. +3 −2 lib/index.js
  2. +4 −0 test/result-tests.js
View
@@ -40,9 +40,10 @@ var aggregateActionResults = function(action) {
var times = action.repeats.map(function(repeat) {
return repeat.end - repeat.start
})
- action.meanTime = (times.reduce(function(prev, next) {
+ action.totalTime = times.reduce(function(prev, next) {
return prev + next
- })/action.repeats.length)
+ })
+ action.meanTime = (action.totalTime/action.repeats.length)
}
module.exports = bench
View
@@ -34,9 +34,13 @@ test('results', function() {
test('rollup data', function() {
action.meanTime.should.be.within(9, 11)
+ action.totalTime.should.be.within(90, 110)
})
+
})
+
+
}))
})

0 comments on commit afd6a8a

Please sign in to comment.