blob: 780168605998f448a3d04e73d898452f5ed0e2c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// @flow
/* eslint-env mocha */
/* global suite, benchmark */
import subSeconds from '.'
import moment from 'moment'
suite('subSeconds', function () {
benchmark('date-fns', function () {
return subSeconds(this.date, 100)
})
benchmark('Moment.js', function () {
return this.moment.subtract(100, 'seconds')
})
}, {
setup: function () {
this.date = new Date()
this.moment = moment()
}
})
|