Re: Measuring startup time



2005/12/19, Milen Dzhumerov <gamehack 1nsp1r3d co uk>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I wanted to ask what's the appropriate way to measure the startup time
> of an application? Should I use clock() and comment out gtkmain()
> assuming that it doesn't have a high overhead and only starts the
> mainloop? Or some other technique?

Use GLibs GTimer[1] functions for this. You can then call
g_timer_elapsed() at pre-defined locations in the code. If you want to
get the time when the app is completely finished loading, you can add
an idle handler to the main loop - if I'm not completely wrong, it
will be called as soon as GTK has finished all its stuff.

Isak

[1] http://developer.gnome.org/doc/API/2.0/glib/glib-Timers.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]