summaryrefslogtreecommitdiff
path: root/date-fns/src/differenceInCalendarMonths/benchmark.js
blob: 7530bf02041bf4eb15807c1f026e5fdd5d1b3803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// @flow
/* eslint-env mocha */
/* global suite, benchmark */

import differenceInCalendarMonths from '.'

suite('differenceInCalendarMonths', function () {
  benchmark('date-fns', function () {
    return differenceInCalendarMonths(this.dateA, this.dateB)
  })
}, {
  setup: function () {
    this.dateA = new Date()
    this.dateB = new Date(this.dateA.getTime() + 604800000)
  }
})