Skip to content

Commit

Permalink
simplify uptime calculation
Browse files Browse the repository at this point in the history
git-svn-id: https://htop.svn.sourceforge.net/svnroot/htop/trunk@147 63cc0a6c-1f0e-0410-841e-f6a342073da8
  • Loading branch information
loderunner committed Mar 11, 2009
1 parent 1e492e4 commit c16efc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UptimeMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c16efc9

Please sign in to comment.