diff --git a/src/core/weechat.c b/src/core/weechat.c index 8d60ba4..d0dd652 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #ifdef HAVE_LANGINFO_CODESET @@ -373,6 +374,10 @@ weechat_shutdown (int return_code, int crash) int main (int argc, char *argv[]) { + struct timeval tv1, tv2, tv3, tv4; + long diff1, diff2, diff3; + + gettimeofday (&tv1, NULL); setlocale (LC_ALL, ""); /* initialize gettext */ #ifdef ENABLE_NLS bindtextdomain (PACKAGE, LOCALEDIR); @@ -408,11 +413,13 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); network_init (); /* init networking */ gui_main_init (); /* init WeeChat interface */ + gettimeofday (&tv2, NULL); if (weechat_upgrading) { upgrade_weechat_load (); /* upgrade with session file */ weechat_upgrade_count++; /* increase /upgrade count */ } + gettimeofday (&tv3, NULL); weechat_welcome_message (); /* display WeeChat welcome message */ command_startup (0); /* command executed before plugins */ plugin_init (weechat_auto_load_plugins, /* init plugin interface(s) */ @@ -422,6 +429,14 @@ main (int argc, char *argv[]) if (weechat_upgrading) upgrade_weechat_remove_files ();/* remove .upgrade files */ weechat_upgrading = 0; + gettimeofday (&tv4, NULL); + + diff1 = util_timeval_diff (&tv1, &tv2); + diff2 = util_timeval_diff (&tv2, &tv3); + diff3 = util_timeval_diff (&tv3, &tv4); + gui_chat_printf (NULL, "DEBUG: start --> before restore: %6ld ms", diff1); + gui_chat_printf (NULL, "DEBUG: time for restore : %6ld ms", diff2); + gui_chat_printf (NULL, "DEBUG: after restore until now : %6ld ms", diff3); gui_main_loop (); /* WeeChat main loop */