Skip to content

Commit e026a3f

Browse files
committed
Restore actually useful test code change
1 parent c769a10 commit e026a3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

integration-tests/profiler/codehotspots.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ const busyCycleTime = BigInt(process.env.BUSY_CYCLE_TIME)
1111

1212
function busyLoop () {
1313
const start = process.hrtime.bigint()
14+
let x = 0
1415
for (;;) {
1516
const now = process.hrtime.bigint()
1617
// Busy cycle
1718
if (now - start > busyCycleTime) {
1819
break
1920
}
21+
// Do something in addition to invoking hrtime
22+
for (let i = 0; i < 1000; i++) {
23+
x += Math.sqrt(Math.random() * 2 - 1)
24+
}
2025
}
26+
return x
2127
}
2228

2329
let counter = 0

0 commit comments

Comments
 (0)