Changeset 1ab8539 in mainline for uspace/app/testread/testread.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/testread/testread.c

    r9696b01 r1ab8539  
    123123        struct timeval prev_time;
    124124        struct timeval start_time;
    125         int rc;
    126         rc = gettimeofday(&start_time, NULL);
    127         if (rc != EOK) {
    128                 printf("gettimeofday failed\n");
    129                 fclose(file);
    130                 free(buf);
    131                 return 1;
    132         }
     125        gettimeofday(&start_time, NULL);
    133126        prev_time = start_time;
    134127       
     
    155148                if (progress && offset >= next_mark) {
    156149                        struct timeval cur_time;
    157                         rc = gettimeofday(&cur_time, NULL);
    158                         if (rc != EOK) {
    159                                 printf("gettimeofday failed\n");
    160                                 fclose(file);
    161                                 free(buf);
    162                                 return 1;
    163                         }
     150                        gettimeofday(&cur_time, NULL);
     151                       
    164152                        uint32_t last_run = cur_time.tv_sec - prev_time.tv_sec;
    165153                        uint32_t total_time = cur_time.tv_sec - start_time.tv_sec;
     
    178166       
    179167        struct timeval final_time;
    180         rc = gettimeofday(&final_time, NULL);
    181         if (rc != EOK) {
    182                 printf("gettimeofday failed\n");
    183                 fclose(file);
    184                 free(buf);
    185                 return 1;
    186         }
     168        gettimeofday(&final_time, NULL);
    187169       
    188170        uint32_t total_run_time = final_time.tv_sec - start_time.tv_sec;
Note: See TracChangeset for help on using the changeset viewer.