xref: /third_party/node/test/fixtures/workload/allocation-sigint.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/workload/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst util = require('util');
41cb0ef41Sopenharmony_ciconst total = parseInt(process.env.TEST_ALLOCATION) || 100;
51cb0ef41Sopenharmony_cilet count = 0;
61cb0ef41Sopenharmony_cilet string = '';
71cb0ef41Sopenharmony_cifunction runAllocation() {
81cb0ef41Sopenharmony_ci  string += util.inspect(process.env);
91cb0ef41Sopenharmony_ci  if (count++ < total) {
101cb0ef41Sopenharmony_ci    setTimeout(runAllocation, 1);
111cb0ef41Sopenharmony_ci  } else {
121cb0ef41Sopenharmony_ci    console.log(string.length);
131cb0ef41Sopenharmony_ci    process.kill(process.pid, "SIGINT");
141cb0ef41Sopenharmony_ci  }
151cb0ef41Sopenharmony_ci}
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_cisetTimeout(runAllocation, 1);
18

Indexes created Thu Nov 07 10:32:03 CST 2024