diff --git a/src/vs/workbench/electron-main/bootstrap.js b/src/vs/workbench/electron-main/bootstrap.js index 2522c0586cb87..fdcc94bbf0023 100644 --- a/src/vs/workbench/electron-main/bootstrap.js +++ b/src/vs/workbench/electron-main/bootstrap.js @@ -6,7 +6,7 @@ /* global __filename, __dirname, global, process */ // Perf measurements -global.vscodeStart = new Date().getTime(); +global.vscodeStart = Date.now(); var app = require('app'); var path = require('path'); diff --git a/src/vs/workbench/electron-main/main.ts b/src/vs/workbench/electron-main/main.ts index 9a6abb9d1eb15..9cbfe693e660e 100644 --- a/src/vs/workbench/electron-main/main.ts +++ b/src/vs/workbench/electron-main/main.ts @@ -244,9 +244,6 @@ function setupIPC(): TPromise { return setup(true); } -function setupMutex() { -} - // On some platforms we need to manually read from the global environment variables // and assign them to the process environment (e.g. when doubleclick app on Mac) getUserEnvironment() @@ -255,7 +252,6 @@ getUserEnvironment() return timebomb() .then(setupIPC) - .then(ipcServer => { setupMutex(); return ipcServer; }) .then(ipcServer => main(ipcServer, userEnv)); }) - .done(null, quit); + .done(null, quit); \ No newline at end of file diff --git a/src/vs/workbench/electron-main/windows.ts b/src/vs/workbench/electron-main/windows.ts index 36f1729fc3518..35ebd34b5fe02 100644 --- a/src/vs/workbench/electron-main/windows.ts +++ b/src/vs/workbench/electron-main/windows.ts @@ -302,6 +302,17 @@ export class WindowsManager { app.on('will-quit', () => { storage.setItem(WindowsManager.windowsStateStorageKey, this.windowsState); }); + + let loggedStartupTimes = false; + onReady(window => { + if (loggedStartupTimes) { + return; // only for the first window + } + + loggedStartupTimes = true; + + window.send('vscode:telemetry', { eventName: 'startupTime', data: { ellapsed: Date.now() - global.vscodeStart } }); + }); } public reload(win: window.VSCodeWindow, cli?: env.ICommandLineArguments): void {