diff options
Diffstat (limited to 'ext/node')
-rw-r--r-- | ext/node/polyfills/process.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 42c55ccc5..779eefb8c 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -647,7 +647,11 @@ class Process extends EventEmitter { execPath = path; } - #startTime = Date.now(); + setStartTime(t: number) { + this.#startTime = t; + } + + #startTime = 0; /** https://nodejs.org/api/process.html#processuptime */ uptime() { return (Date.now() - this.#startTime) / 1000; @@ -762,6 +766,9 @@ internals.__bootstrapNodeProcess = function ( "stdout", ); + process.setStartTime(Date.now()); + // @ts-ignore Remove setStartTime and #startTime is not modifiable + delete process.setStartTime; delete internals.__bootstrapNodeProcess; }; |