Changes in uspace/app/top/top.c [d76a329:1ab8539] in mainline


Ignore:
File:
1 edited

Legend:

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

    rd76a329 r1ab8539  
    156156        /* Get current time */
    157157        struct timeval time;
    158         if (gettimeofday(&time, NULL) != EOK)
    159                 return "Cannot get time of day";
     158        gettimeofday(&time, NULL);
    160159       
    161160        target->hours = (time.tv_sec % DAY) / HOUR;
     
    164163       
    165164        /* Get uptime */
    166         sysarg_t uptime = stats_get_uptime();
    167         target->udays = uptime / DAY;
    168         target->uhours = (uptime % DAY) / HOUR;
    169         target->uminutes = (uptime % HOUR) / MINUTE;
    170         target->useconds = uptime % MINUTE;
     165        struct timeval uptime;
     166        getuptime(&uptime);
     167       
     168        target->udays = uptime.tv_sec / DAY;
     169        target->uhours = (uptime.tv_sec % DAY) / HOUR;
     170        target->uminutes = (uptime.tv_sec % HOUR) / MINUTE;
     171        target->useconds = uptime.tv_sec % MINUTE;
    171172       
    172173        /* Get load */
Note: See TracChangeset for help on using the changeset viewer.