Skip to content

Commit

Permalink
show time diff used to load a subapp
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Mar 24, 2020
1 parent cbc2bcc commit ee0b34d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/subapp-web/lib/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,12 @@ ${stack}`,
}
};

let startTime;

const closeOutput = () => {
if (props.timestamp) {
outputSpot.add(`<!-- time: ${Date.now()} -->`);
const now = Date.now();
outputSpot.add(`<!-- time: ${now} diff: ${now - startTime} -->`);
}

outputSpot.close();
Expand Down Expand Up @@ -352,7 +355,8 @@ ${stack}`,

const asyncProcess = async () => {
if (props.timestamp) {
outputSpot.add(`<!-- time: ${Date.now()} -->`);
startTime = Date.now();
outputSpot.add(`<!-- time: ${startTime} -->`);
}

try {
Expand Down

0 comments on commit ee0b34d

Please sign in to comment.