]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
perf: add duration benchmark, cleanup benchmarking output
authorBrian Wyant <wyantb@gmail.com>
Sun, 10 May 2015 02:06:10 +0000 (22:06 -0400)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 13 Jul 2015 00:00:30 +0000 (17:00 -0700)
benchmarks/clone.js
benchmarks/fromDate.js
benchmarks/fromDateUtc.js
benchmarks/makeDuration.js [new file with mode: 0644]

index e8a61f3d9edab92dc966fd1bc3ae819c4466fac3..ac516bec2d5285e9c01bbe0f03e325d4d69e99f0 100644 (file)
@@ -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
 };
index b49f407f87b3404e4cd77895dea0efd031ec9280..613061c4dae7342507a12ca6b61da103b6a504fe 100644 (file)
@@ -4,7 +4,7 @@ var Benchmark = require('benchmark'),
 
 module.exports = {
   name: 'fromDate',
-  onComplete: function(){console.log('done');},
+  onComplete: function(){},
   fn: function(){
       moment(base);
   },
index bdfff1cea3419abccb744b464ba3d61eb0161758..37d1a71015df2c96504ec60094c2fa785875c055 100644 (file)
@@ -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 (file)
index 0000000..9c2e800
--- /dev/null
@@ -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
+};