xref: /third_party/node/test/fixtures/v8-coverage/interval.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/v8-coverage/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cilet counter = 0;
31cb0ef41Sopenharmony_cilet result;
41cb0ef41Sopenharmony_ciconst TEST_INTERVALS = parseInt(process.env.TEST_INTERVALS) || 1;
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst i = setInterval(function interval() {
71cb0ef41Sopenharmony_ci  counter++;
81cb0ef41Sopenharmony_ci  if (counter < TEST_INTERVALS) {
91cb0ef41Sopenharmony_ci    result = 1;
101cb0ef41Sopenharmony_ci  } else {
111cb0ef41Sopenharmony_ci    result = process.hrtime();
121cb0ef41Sopenharmony_ci    clearInterval(i);
131cb0ef41Sopenharmony_ci  }
141cb0ef41Sopenharmony_ci}, 100);
15

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