summaryrefslogtreecommitdiff
path: root/date-fns/src/eachHourOfInterval/benchmark.js
diff options
context:
space:
mode:
Diffstat (limited to 'date-fns/src/eachHourOfInterval/benchmark.js')
-rw-r--r--date-fns/src/eachHourOfInterval/benchmark.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/date-fns/src/eachHourOfInterval/benchmark.js b/date-fns/src/eachHourOfInterval/benchmark.js
new file mode 100644
index 0000000..c96c557
--- /dev/null
+++ b/date-fns/src/eachHourOfInterval/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachHourOfInterval from '.'
+
+suite(
+ 'eachHourOfInterval',
+ function() {
+ benchmark('date-fns', function() {
+ return eachHourOfInterval({ start: this.dateA, end: this.dateB })
+ })
+ },
+ {
+ setup: function() {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+ }
+)