summaryrefslogtreecommitdiff
path: root/date-fns/src/endOfQuarter/benchmark.js
blob: 6ec16a53ff37145e2031db751512c3d9736242c2 (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 endOfQuarter from '.'
import moment from 'moment'

suite('endOfQuarter', function () {
  benchmark('date-fns', function () {
    return endOfQuarter(this.date)
  })

  benchmark('Moment.js', function () {
    return this.moment.endOf('quarter')
  })
}, {
  setup: function () {
    this.date = new Date()
    this.moment = moment()
  }
})