Respond to PR feedback.
This commit is contained in:
parent
3f18553a97
commit
4093f311c9
|
@ -36,14 +36,12 @@ export class ExecutionTimeTracker {
|
|||
|
||||
track<T>(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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue