Re: [MM] [PATCH v2] modem: log time taken for succeeded operations



On 22/01/13 06:10, Ben Chan wrote:
> This patch logs the time taken for succeeded initialization, enabling,
> disabling, connection, and disconnection operations, which helps
> evaluate how to optimize modem plugins.
> ---

> +
> +gdouble
> +mm_utils_subtract_time (const GTimeVal *end_time, const GTimeVal *start_time)
> +{
> +    return (end_time->tv_sec - start_time->tv_sec) +
> +           (end_time->tv_usec - start_time->tv_usec) / 1.0e6;
> +}


If you want to log how long it takes, better use a GTimer instead of two
GTimeVals:

http://developer.gnome.org/glib/unstable/glib-Timers.html

-- 
Aleksander


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