Re: [MM] [PATCH v2] modem: log time taken for succeeded operations
- From: Aleksander Morgado <aleksander lanedo com>
- To: Ben Chan <benchan chromium org>
- Cc: networkmanager-list gnome org
- Subject: Re: [MM] [PATCH v2] modem: log time taken for succeeded operations
- Date: Tue, 22 Jan 2013 09:57:46 +0100
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]