Calculate load time in index.js
Do it previously in window-bootstrap caused several things to not be included such as requiring coffee script and atom shell modules. Now it is a much more accurate representation of on load time.
Esse commit está contido em:
@@ -1,14 +1,10 @@
|
||||
# Like sands through the hourglass, so are the days of our lives.
|
||||
startTime = Date.now()
|
||||
|
||||
require './window'
|
||||
|
||||
Atom = require './atom'
|
||||
window.atom = Atom.loadOrCreate('editor')
|
||||
atom.initialize()
|
||||
atom.startEditorWindow()
|
||||
window.atom.loadTime = Date.now() - startTime
|
||||
console.log "Window load time: #{atom.getWindowLoadTime()}ms"
|
||||
|
||||
# Workaround for focus getting cleared upon window creation
|
||||
windowFocused = ->
|
||||
|
||||
+8
-1
@@ -1,5 +1,7 @@
|
||||
window.onload = function() {
|
||||
try {
|
||||
var startTime = Date.now();
|
||||
|
||||
// Skip "?loadSettings=".
|
||||
var loadSettings = JSON.parse(decodeURIComponent(location.search.substr(14)));
|
||||
|
||||
@@ -30,7 +32,12 @@ window.onload = function() {
|
||||
require('../src/coffee-cache').register();
|
||||
|
||||
require(loadSettings.bootstrapScript);
|
||||
require('ipc').sendChannel('window-command', 'window:loaded')
|
||||
require('ipc').sendChannel('window-command', 'window:loaded');
|
||||
|
||||
if (global.atom) {
|
||||
global.atom.loadTime = Date.now() - startTime;
|
||||
console.log('Window load time: ' + global.atom.getWindowLoadTime() + 'ms');
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
var currentWindow = require('remote').getCurrentWindow();
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário