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

    r9696b01 r1ab8539  
    6262{
    6363        struct timeval start_time;
    64         int rc;
    65         rc = gettimeofday(&start_time, NULL);
    66         if (rc != EOK) {
    67                 fprintf(stderr, "gettimeofday failed\n");
    68                 return rc;
    69         }
    70        
    71         rc = fn(data);
     64        gettimeofday(&start_time, NULL);
     65       
     66        int rc = fn(data);
    7267        if (rc != EOK) {
    7368                fprintf(stderr, "measured function failed\n");
    7469                return rc;
    7570        }
    76 
     71       
    7772        struct timeval final_time;
    78         rc = gettimeofday(&final_time, NULL);
    79         if (rc != EOK) {
    80                 fprintf(stderr, "gettimeofday failed\n");
    81                 return rc;
    82         }
     73        gettimeofday(&final_time, NULL);
    8374       
    8475        /* Calculate time difference in milliseconds */
     
    9283        char *path = (char *) data;
    9384        char *buf = malloc(BUFSIZE);
    94 
    95         if (buf == NULL) {
     85       
     86        if (buf == NULL)
    9687                return ENOMEM;
    97         }
    9888       
    9989        FILE *file = fopen(path, "r");
Note: See TracChangeset for help on using the changeset viewer.