summaryrefslogtreecommitdiff
path: root/date-fns/src/setSeconds/benchmark.js
diff options
context:
space:
mode:
Diffstat (limited to 'date-fns/src/setSeconds/benchmark.js')
-rw-r--r--date-fns/src/setSeconds/benchmark.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/date-fns/src/setSeconds/benchmark.js b/date-fns/src/setSeconds/benchmark.js
new file mode 100644
index 0000000..41733f2
--- /dev/null
+++ b/date-fns/src/setSeconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setSeconds from '.'
+import moment from 'moment'
+
+suite('setSeconds', function () {
+ benchmark('date-fns', function () {
+ return setSeconds(this.date, 15)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.seconds(15)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})