summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2017-03-13 22:01:35 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2017-03-13 22:01:35 +0100
commitfbd89b52c144abcba6153e1f8cab1b8b5ea61940 (patch)
tree6e03747787c14d3c8fb6d48189f75dc0ffbcf3ee /bin
parent01d9f9a9b7059fff34089bc7f3eea575b079447a (diff)
downloaddrakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar.gz
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar.bz2
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar.xz
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.zip
Prefer add_seconds() over add() as it uses less CPU and memory
Diffstat (limited to 'bin')
-rwxr-xr-xbin/net_applet4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/net_applet b/bin/net_applet
index 683add7..4732e9c 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -453,7 +453,7 @@ sub checkNetworkForce() {
}
sub cronNetwork() {
my $i;
- $timeout = Glib::Timeout->add(2000, sub {
+ $timeout = Glib::Timeout->add_seconds(2, sub {
checkWireless() if !($i++%30);
checkNetwork();
1;
@@ -489,7 +489,7 @@ sub go2State {
my $timeout = 5000;
$bubble->set_timeout($timeout);
# both need to be in a eval block in case notification daemon isn't running:
- Glib::Timeout->add($timeout, sub { eval { $bubble->close }; 0 });
+ Glib::Timeout->add_seconds($timeout/1000, sub { eval { $bubble->close }; 0 });
eval { $bubble->show };
warn ">> ERR:$@" if $@;
$need_update = 1;