fetching time

This commit is contained in:
antelle 2020-03-29 11:11:16 +02:00
parent 7c16a79629
commit cb150bdba9
No known key found for this signature in database
GPG Key ID: 094A2F2D6136A4EE
2 changed files with 2 additions and 8 deletions

View File

@ -3,9 +3,6 @@
<head lang="en">
<meta charset="UTF-8" />
<title>KeeWeb</title>
<script>
window.htmlLoadTime = performance.now();
</script>
<meta name="application-name" content="KeeWeb" />
<meta name="kw-signature" content="" />
<meta name="kw-config" content="(no-config)" />

View File

@ -2,7 +2,7 @@ import { Logger } from 'util/logger';
const logger = new Logger('start-profiler');
let lastTs = window.htmlLoadTime;
let lastTs = 0;
const operations = [];
@ -16,10 +16,7 @@ const StartProfiler = {
report() {
const networkTime = this.getNetworkTime();
operations.unshift(
{ name: 'fetching', elapsed: networkTime },
{ name: 'parsing', elapsed: window.htmlLoadTime - networkTime }
);
operations.unshift({ name: 'fetching', elapsed: networkTime });
const time = Math.round(performance.now());
const details = operations.map(op => `${op.name}=${Math.round(op.elapsed)}ms`).join(', ');