mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
a11y: optimize performance test output on web
This commit is contained in:
1 file changed
+7
-3
@@ -195,9 +195,13 @@ export async function startPerformanceTest(args: { enable5: boolean }, report) {
|
|||||||
const timeArr = results[key];
|
const timeArr = results[key];
|
||||||
if (!timeArr) continue;
|
if (!timeArr) continue;
|
||||||
const avgTime = Math.sum(...timeArr) / 20;
|
const avgTime = Math.sum(...timeArr) / 20;
|
||||||
report({ message: `-------Test ${key}-------` });
|
await report({
|
||||||
report({ message: ` Avg: ${formatL(avgTime)} D: ${formatR(Math.sum(...timeArr.map((i) => (i - avgTime) ** 2)) / 20, 5)} ` });
|
message: [
|
||||||
report({ message: ` Max: ${formatL(Math.max(...timeArr))} Min: ${formatR(Math.min(...timeArr))} ` });
|
`-------Test ${key}-------`,
|
||||||
|
` Avg: ${formatL(avgTime)} D: ${formatR(Math.sum(...timeArr.map((i) => (i - avgTime) ** 2)) / 20, 5)} `,
|
||||||
|
` Max: ${formatL(Math.max(...timeArr))} Min: ${formatR(Math.min(...timeArr))} `,
|
||||||
|
].join('\n'),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user