summaryrefslogtreecommitdiffstats
path: root/UptimeMeter.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2009-03-11 13:26:39 +0000
committerHisham Muhammad <hisham@gobolinux.org>2009-03-11 13:26:39 +0000
commit385a7dbe1ec8b8a64d8999019028cce71565c4dc (patch)
treed95f032cae3e6265dd1463d293f79c9f7ecfeb40 /UptimeMeter.c
parent3b950e41896219c9d21f9bc13616bfc6333b345c (diff)
simplify uptime calculation
Diffstat (limited to 'UptimeMeter.c')
-rw-r--r--UptimeMeter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/UptimeMeter.c b/UptimeMeter.c
index ec1e72ad..0e716539 100644
--- a/UptimeMeter.c
+++ b/UptimeMeter.c
@@ -25,9 +25,9 @@ static void UptimeMeter_setValues(Meter* this, char* buffer, int len) {
fclose(fd);
int totalseconds = (int) ceil(uptime);
int seconds = totalseconds % 60;
- int minutes = (totalseconds-seconds) % 3600 / 60;
- int hours = (totalseconds-seconds-(minutes*60)) % 86400 / 3600;
- int days = (totalseconds-seconds-(minutes*60)-(hours*3600)) / 86400;
+ int minutes = (totalseconds/60) % 60;
+ int hours = (totalseconds/3600) % 24;
+ int days = (totalseconds/86400);
this->values[0] = days;
if (days > this->total) {
this->total = days;

© 2014-2024 Faster IT GmbH | imprint | privacy policy