Be sure to always initialize startup timers

This commit is contained in:
Christian Dywan 2011-11-28 23:41:32 +01:00
parent b3344bf6f7
commit 0e93695979

View file

@ -1237,9 +1237,7 @@ midori_load_extensions (gpointer data)
KatzeArray* extensions; KatzeArray* extensions;
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL; gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
GTimer* timer; GTimer* timer = startup_timer ? g_timer_new () : NULL;
if (startup_timer)
timer = g_timer_new ();
#endif #endif
/* Load extensions */ /* Load extensions */
@ -1323,7 +1321,7 @@ midori_load_extensions (gpointer data)
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
if (startup_timer) if (startup_timer)
g_debug ("Extensions:\t%f", g_test_timer_elapsed ()); g_debug ("Extensions:\t%f", g_timer_elapsed (timer, NULL));
#endif #endif
return FALSE; return FALSE;
@ -1369,9 +1367,7 @@ midori_load_session (gpointer data)
gchar** command = g_object_get_data (G_OBJECT (app), "execute-command"); gchar** command = g_object_get_data (G_OBJECT (app), "execute-command");
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL; gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL;
GTimer* timer; GTimer* timer = startup_timer ? g_timer_new () : NULL;
if (startup_timer)
timer = g_timer_new ();
#endif #endif
browser = midori_app_create_browser (app); browser = midori_app_create_browser (app);
@ -1450,7 +1446,7 @@ midori_load_session (gpointer data)
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
if (startup_timer) if (startup_timer)
g_debug ("Session setup:\t%f", g_test_timer_elapsed ()); g_debug ("Session setup:\t%f", g_timer_elapsed (timer, NULL));
#endif #endif
return FALSE; return FALSE;
@ -2028,11 +2024,6 @@ main (int argc,
else else
g_set_application_name (_("Midori")); g_set_application_name (_("Midori"));
#ifdef G_ENABLE_DEBUG
if (startup_timer)
g_test_timer_start ();
#endif
if (version) if (version)
{ {
g_print ( g_print (