Log app startup time

This commit is contained in:
Josh Perez 2021-01-15 12:30:58 -05:00 committed by Scott Nonnenberg
parent 8a72607fa7
commit bba50c8427
4 changed files with 12 additions and 1 deletions

View file

@ -866,6 +866,14 @@ function showPermissionsPopupWindow(forCalling, forCamera) {
// Some APIs can only be used after this event occurs.
let ready = false;
app.on('ready', async () => {
const startTime = Date.now();
// We use this event only a single time to log the startup time of the app
// from when it's first ready until the loading screen disappears.
ipc.once('signal-app-loaded', () => {
console.log('App has finished loading in:', Date.now() - startTime);
});
const userDataPath = await getRealPath(app.getPath('userData'));
const installPath = await getRealPath(app.getAppPath());