From fe43941f27da491522aafcec3313919d8418481a Mon Sep 17 00:00:00 2001 From: Brian Wyant Date: Sat, 9 May 2015 22:06:10 -0400 Subject: [PATCH] perf: add duration benchmark, cleanup benchmarking output --- benchmarks/clone.js | 2 +- benchmarks/fromDate.js | 2 +- benchmarks/fromDateUtc.js | 2 +- benchmarks/makeDuration.js | 11 +++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 benchmarks/makeDuration.js diff --git a/benchmarks/clone.js b/benchmarks/clone.js index e8a61f3d9..ac516bec2 100644 --- a/benchmarks/clone.js +++ b/benchmarks/clone.js @@ -4,7 +4,7 @@ var Benchmark = require('benchmark'), module.exports = { name: 'clone', - onComplete: function(){console.log('done');}, + onComplete: function(){}, fn: function(){base.clone();}, async: true }; diff --git a/benchmarks/fromDate.js b/benchmarks/fromDate.js index b49f407f8..613061c4d 100644 --- a/benchmarks/fromDate.js +++ b/benchmarks/fromDate.js @@ -4,7 +4,7 @@ var Benchmark = require('benchmark'), module.exports = { name: 'fromDate', - onComplete: function(){console.log('done');}, + onComplete: function(){}, fn: function(){ moment(base); }, diff --git a/benchmarks/fromDateUtc.js b/benchmarks/fromDateUtc.js index bdfff1cea..37d1a7101 100644 --- a/benchmarks/fromDateUtc.js +++ b/benchmarks/fromDateUtc.js @@ -4,7 +4,7 @@ var Benchmark = require('benchmark'), module.exports = { name: 'fromDateUtc', - onComplete: function(){console.log('done');}, + onComplete: function(){}, fn: function(){ moment.utc(base); }, diff --git a/benchmarks/makeDuration.js b/benchmarks/makeDuration.js new file mode 100644 index 000000000..9c2e8003f --- /dev/null +++ b/benchmarks/makeDuration.js @@ -0,0 +1,11 @@ +var Benchmark = require('benchmark'), + moment = require('./../moment.js'); + +module.exports = { + name: 'makeDuration', + onComplete: function(){}, + fn: function(){ + moment.duration(5, 'years'); + }, + async: true +}; -- 2.47.2