1'use strict';
2const common = require('../../common.js');
3
4let binding;
5try {
6  binding = require(`./build/${common.buildType}/binding`);
7} catch {
8  console.error(`${__filename}: Binding failed to load`);
9  process.exit(0);
10}
11
12const bench = common.createBenchmark(main, {
13  n: [1e5, 1e6, 1e7],
14  stringType: ['Latin1', 'Utf8', 'Utf16'],
15});
16
17function main({ n, stringType }) {
18  binding[`createString${stringType}`](n, bench, bench.start, bench.end);
19}
20