Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
},
"license": "Apache-2.0",
"dependencies": {
"delay": "^5.0.0",
"node-gyp-build": "<4.0",
"p-limit": "^3.1.0",
"pprof-format": "^2.2.1",
Expand Down
4 changes: 2 additions & 2 deletions ts/src/time-profiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import delay from 'delay';
import {setTimeout} from 'timers/promises';

import {
serializeTimeProfile,
Expand Down Expand Up @@ -84,7 +84,7 @@ const DEFAULT_OPTIONS: TimeProfilerOptions = {
export async function profile(options: TimeProfilerOptions = {}) {
options = {...DEFAULT_OPTIONS, ...options};
start(options);
await delay(options.durationMillis!);
await setTimeout(options.durationMillis!);
return stop();
}

Expand Down
4 changes: 2 additions & 2 deletions ts/test/test-time-profiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import delay from 'delay';
import * as sinon from 'sinon';
import {time, getNativeThreadId} from '../src';
import * as v8TimeProfiler from '../src/time-profiler-bindings';
Expand All @@ -25,6 +24,7 @@ import {AssertionError} from 'assert';
import {GenerateTimeLabelsArgs, LabelSet} from '../src/v8-types';
import {AsyncLocalStorage} from 'async_hooks';
import {satisfies} from 'semver';
import {setTimeout as setTimeoutPromise} from 'timers/promises';

import assert from 'assert';

Expand Down Expand Up @@ -470,7 +470,7 @@ describe('Time Profiler', () => {
time.profile(PROFILE_OPTIONS).then(() => {
isProfiling = false;
});
await delay(2 * PROFILE_OPTIONS.durationMillis);
await setTimeoutPromise(2 * PROFILE_OPTIONS.durationMillis);
assert.strictEqual(false, isProfiling, 'profiler is still running');
});

Expand Down