gnetworkmonitornetlink: Use a coarser-grained timer for dumps

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 <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=793880
This commit is contained in:
Philip Withnall 2018-02-27 12:49:11 +00:00
parent 85f3bc133f
commit 23fad11430

View File

@ -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);