summaryrefslogtreecommitdiff
path: root/test/fixtures/linux-perf.js
blob: 90ea2f2e33fd78a5e71f1db61b2767378be31183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';

const { spawnSync } = require("child_process");
const sleepTime = new Number(process.argv[2] || "0.1");
const repeat = new Number(process.argv[3]) || 5;

function functionOne() {
  functionTwo();
}

function functionTwo() {
  spawnSync('sleep', [`${sleepTime}`]);
}

for (let i = 0; i < repeat; i++) {
  functionOne();
}