summaryrefslogtreecommitdiff
path: root/cpuload.pl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-07 10:34:16 +0000
committerPaul Buetow <paul@buetow.org>2010-11-07 10:34:16 +0000
commit76ffc1c25f8503ed98021a28bce9bce6686d5da0 (patch)
tree106f30d7e4b8b7fa48ba6bbf21e96d81167c1053 /cpuload.pl
parent3de2059bbab3ffcf8928a402543714470f21765a (diff)
small bugfix
Diffstat (limited to 'cpuload.pl')
-rwxr-xr-xcpuload.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpuload.pl b/cpuload.pl
index 42d4399..9d31388 100755
--- a/cpuload.pl
+++ b/cpuload.pl
@@ -124,7 +124,10 @@ sub graph_stats ($$) {
my %last_loads;
loop {
- my $width = WIDTH / (keys %STATS) - 1;
+ my $width = do {
+ sleep 1 until %STATS;
+ WIDTH / (keys %STATS) - 1
+ };
my ($x, $y) = (0, 0);
for my $key (sort keys %STATS) {