diff --git a/src/common/runtime/server.ts b/src/common/runtime/server.ts index 3e49ce67c028..41dad4b27fea 100644 --- a/src/common/runtime/server.ts +++ b/src/common/runtime/server.ts @@ -48,6 +48,8 @@ interface RunResult { status: Status; // Any additional messages printed message: string; + // The time it took to execute the test + durationMS: number; // Code coverage data, if the server was started with `--coverage` // This data is opaque (implementation defined). coverageData?: string; @@ -202,14 +204,16 @@ if (verbose) { if (codeCoverage !== undefined) { codeCoverage.begin(); } + const start = performance.now(); const result = await runTestcase(testcase); + const durationMS = performance.now() - start; const coverageData = codeCoverage !== undefined ? codeCoverage.end() : undefined; let message = ''; if (result.logs !== undefined) { message = result.logs.map(log => prettyPrintLog(log)).join('\n'); } const status = result.status; - const res: RunResult = { status, message, coverageData }; + const res: RunResult = { status, message, durationMS, coverageData }; response.statusCode = 200; response.end(JSON.stringify(res)); } else {