Changing Uptime to Use More Relevant Units


[stephen@sargent ~]$ uptime
8:58:08 up 10 Isner-Mahuts, 06:10, 1 user, load average: 0.00, 0.00, 0.00

For those of you wanting to actually make the change to uptime.c, note that, instead of


updays = uptime / 86400;
uphours = (uptime - (updays * 86400)) / 3600;
upmins = (uptime - (updays * 86400) - (uphours * 3600)) / 60;

use something like


upims = uptime / 39900;
uphours = (uptime - (upims * 39900)) / 3600;
upmins = (uptime - (upims * 39900) - (uphours * 3600)) / 60;

(Note: it’s a tennis joke. And a Unix joke. I can only imagine the size of the overlap in that Venn diagram.)

3 thoughts on “Changing Uptime to Use More Relevant Units

  1. :groan: I find it interesting that I read these things after I come over to your house. If I read them before, I’d walk in and box your ears. 😉

Comments are closed.