From b5a8312167d810938af7ca1a1f81f0363ecfe2d0 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 2 Nov 2015 02:47:43 +0000 Subject: [PATCH] Add startup time measurement --- Wox/App.xaml.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Wox/App.xaml.cs b/Wox/App.xaml.cs index 5fb45331f8..d90577ac92 100644 --- a/Wox/App.xaml.cs +++ b/Wox/App.xaml.cs @@ -5,6 +5,7 @@ using System.Windows; using Wox.CommandArgs; using Wox.Core.Plugin; using Wox.Helper; +using Wox.Infrastructure; namespace Wox { @@ -27,14 +28,18 @@ namespace Wox protected override void OnStartup(StartupEventArgs e) { - base.OnStartup(e); - DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; - AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; + using (new Timeit("Startup Time")) + { + base.OnStartup(e); + DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; + AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; + + Window = new MainWindow(); + PluginManager.Init(Window); + ImageLoader.ImageLoader.PreloadImages(); + CommandArgsFactory.Execute(e.Args.ToList()); + } - Window = new MainWindow(); - PluginManager.Init(Window); - ImageLoader.ImageLoader.PreloadImages(); - CommandArgsFactory.Execute(e.Args.ToList()); } public bool OnActivate(IList args)