Changeset 1ab8539 in mainline for uspace/app/stats/stats.c


Ignore:
Timestamp:
2014-11-14T19:16:23Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5042706
Parents:
9696b01
Message:

remove system.uptime sysinfo entry since it is redundant
cleanup the time handling routines

  • still more cleanup is needed here, the code is a wild combination of quasi-POSIX API (with all the brain-dead types, etc.) and HelenOS API
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/stats/stats.c

    r9696b01 r1ab8539  
    191191static void print_uptime(void)
    192192{
    193         sysarg_t uptime = stats_get_uptime();
    194         printf("%s: Up %" PRIun " days, %" PRIun " hours, "
    195             "%" PRIun " minutes, %" PRIun " seconds\n", NAME,
    196             uptime / DAY, (uptime % DAY) / HOUR,
    197             (uptime % HOUR) / MINUTE, uptime % MINUTE);
     193        struct timeval uptime;
     194        getuptime(&uptime);
     195       
     196        printf("%s: Up %ld days, %ld hours, %ld minutes, %ld seconds\n",
     197            NAME, uptime.tv_sec / DAY, (uptime.tv_sec % DAY) / HOUR,
     198            (uptime.tv_sec % HOUR) / MINUTE, uptime.tv_sec % MINUTE);
    198199}
    199200
Note: See TracChangeset for help on using the changeset viewer.