node/test/parallel/test-v8-cpu-profile.js
theanarkh f9fcc746f3
v8: add cpu profile
PR-URL: https://github.com/nodejs/node/pull/59807
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-10-11 17:20:57 +00:00

13 lines
298 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const v8 = require('v8');
const handle = v8.startCpuProfile();
const profile = handle.stop();
assert.ok(typeof profile === 'string');
assert.ok(profile.length > 0);
// Call stop() again
assert.ok(handle.stop() === undefined);