From 23fad11430eb837ec1058cdb9368f3a6ea352fee Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 27 Feb 2018 12:49:11 +0000 Subject: [PATCH] gnetworkmonitornetlink: Use a coarser-grained timer for dumps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By using g_timeout_source_new_seconds(), we can let timer wakeups be coalesced by the scheduler, and reduce power consumption a bit. This shouldn’t really affect the accuracy of the network monitoring. Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=793880 --- gio/gnetworkmonitornetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c index d7d9cb79a..a5dc6be60 100644 --- a/gio/gnetworkmonitornetlink.c +++ b/gio/gnetworkmonitornetlink.c @@ -206,7 +206,7 @@ queue_request_dump (GNetworkMonitorNetlink *nl) g_source_unref (nl->priv->dump_source); } - nl->priv->dump_source = g_timeout_source_new (1000); + nl->priv->dump_source = g_timeout_source_new_seconds (1); g_source_set_callback (nl->priv->dump_source, (GSourceFunc) timeout_request_dump, nl, NULL); g_source_attach (nl->priv->dump_source, nl->priv->context);