summaryrefslogtreecommitdiffstats
path: root/fastify-busboy/benchmarks/common/executionUtils.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fastify-busboy/benchmarks/common/executionUtils.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/fastify-busboy/benchmarks/common/executionUtils.js b/fastify-busboy/benchmarks/common/executionUtils.js
new file mode 100644
index 0000000..8c52ec8
--- /dev/null
+++ b/fastify-busboy/benchmarks/common/executionUtils.js
@@ -0,0 +1,18 @@
+'use strict'
+
+const { getCommonBuilder } = require('./commonBuilder')
+const { outputResults } = require('./resultUtils')
+
+function getMeasureFn (constestandId, fn) {
+ return () => {
+ const benchmark = getCommonBuilder()
+ .benchmarkEntryName(constestandId)
+ .functionUnderTest(fn).build()
+ const benchmarkResults = benchmark.execute()
+ outputResults(benchmark, benchmarkResults)
+ }
+}
+
+module.exports = {
+ getMeasureFn
+}