diff --git a/packages/backend-core/src/timers/timers.ts b/packages/backend-core/src/timers/timers.ts index 9a8067ee64..3bb556703f 100644 --- a/packages/backend-core/src/timers/timers.ts +++ b/packages/backend-core/src/timers/timers.ts @@ -36,14 +36,12 @@ export class ExecutionTimeTracker { track(f: () => T): T { this.checkLimit() - const [startSeconds, startNanoseconds] = process.hrtime() - const startMs = startSeconds * 1000 + startNanoseconds / 1e6 + const start = process.hrtime.bigint() try { return f() } finally { - const [endSeconds, endNanoseconds] = process.hrtime() - const endMs = endSeconds * 1000 + endNanoseconds / 1e6 - this.totalTimeMs += endMs - startMs + const end = process.hrtime.bigint() + this.totalTimeMs += Number(end - start) / 1e6 this.checkLimit() } } diff --git a/packages/backend-core/src/utils/Duration.ts b/packages/backend-core/src/utils/Duration.ts index 3f5d26c971..730b59d1dc 100644 --- a/packages/backend-core/src/utils/Duration.ts +++ b/packages/backend-core/src/utils/Duration.ts @@ -50,7 +50,7 @@ export class Duration { return Duration.from(DurationType.DAYS, duration) } - static fromMiliseconds(duration: number) { + static fromMilliseconds(duration: number) { return Duration.from(DurationType.MILLISECONDS, duration) } } diff --git a/packages/server/src/javascript.ts b/packages/server/src/jsRunner.ts similarity index 100% rename from packages/server/src/javascript.ts rename to packages/server/src/jsRunner.ts diff --git a/packages/server/src/startup.ts b/packages/server/src/startup.ts index 2d73fe2fb0..6860fe5f9b 100644 --- a/packages/server/src/startup.ts +++ b/packages/server/src/startup.ts @@ -23,7 +23,7 @@ import { automationsEnabled, printFeatures } from "./features" import Koa from "koa" import { Server } from "http" import { AddressInfo } from "net" -import * as javascript from "./javascript" +import * as jsRunner from "./jsRunner" let STARTUP_RAN = false @@ -154,5 +154,5 @@ export async function startup(app?: Koa, server?: Server) { }) } - javascript.init() + jsRunner.init() }