Changes in uspace/app/bnchmark/bnchmark.c [205f1add:1433ecda] in mainline
- File:
-
- 1 edited
-
uspace/app/bnchmark/bnchmark.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bnchmark/bnchmark.c
r205f1add r1433ecda 56 56 57 57 typedef errno_t (*measure_func_t)(void *); 58 typedef unsigned long umseconds_t; /* milliseconds */ 58 59 59 60 static void syntax_print(void); 60 61 61 static errno_t measure(measure_func_t fn, void *data, msec_t *result)62 { 63 struct time specstart_time;64 get uptime(&start_time);62 static errno_t measure(measure_func_t fn, void *data, umseconds_t *result) 63 { 64 struct timeval start_time; 65 gettimeofday(&start_time, NULL); 65 66 66 67 errno_t rc = fn(data); … … 70 71 } 71 72 72 struct time specfinal_time;73 get uptime(&final_time);73 struct timeval final_time; 74 gettimeofday(&final_time, NULL); 74 75 75 76 /* Calculate time difference in milliseconds */ 76 *result = NSEC2USEC(ts_sub_diff(&final_time, &start_time)); 77 *result = ((final_time.tv_usec - start_time.tv_usec) / 1000) + 78 ((final_time.tv_sec - start_time.tv_sec) * 1000); 77 79 return EOK; 78 80 } … … 131 133 { 132 134 errno_t rc; 133 msec_t milliseconds_taken = 0;135 umseconds_t milliseconds_taken = 0; 134 136 char *path = NULL; 135 137 measure_func_t fn = NULL; … … 192 194 } 193 195 194 printf("%s;%s;%s;%l ld;ms\n", test_type, path, log_str, milliseconds_taken);196 printf("%s;%s;%s;%lu;ms\n", test_type, path, log_str, milliseconds_taken); 195 197 } 196 198
Note:
See TracChangeset
for help on using the changeset viewer.
