From 7ac7c49bdc566ec8a4b66679bd41ed2c89f5be5b Mon Sep 17 00:00:00 2001 From: Etienne Samson Date: Wed, 29 Oct 2025 17:11:30 +0100 Subject: [PATCH] fix: prevent torn reads of the IVM's cpuTime --- lib/runtime/runtime.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/runtime/runtime.js b/lib/runtime/runtime.js index 12cce48..bf2e8b0 100644 --- a/lib/runtime/runtime.js +++ b/lib/runtime/runtime.js @@ -23,7 +23,8 @@ global._init = (function() { } : undefined; function nowCpuTime() { - return isolate.cpuTime[0] * 1e3 + isolate.cpuTime[1] / 1e6; + const time = isolate.cpuTime; + return time[0] * 1e3 + time[1] / 1e6; } module.exports.context = context;