Changes in uspace/app/bnchmark/bnchmark.c [1ab8539:c4f7bf6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bnchmark/bnchmark.c
r1ab8539 rc4f7bf6 62 62 { 63 63 struct timeval start_time; 64 gettimeofday(&start_time, NULL); 65 66 int rc = fn(data); 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); 67 72 if (rc != EOK) { 68 73 fprintf(stderr, "measured function failed\n"); 69 74 return rc; 70 75 } 71 76 72 77 struct timeval final_time; 73 gettimeofday(&final_time, NULL); 78 rc = gettimeofday(&final_time, NULL); 79 if (rc != EOK) { 80 fprintf(stderr, "gettimeofday failed\n"); 81 return rc; 82 } 74 83 75 84 /* Calculate time difference in milliseconds */ … … 83 92 char *path = (char *) data; 84 93 char *buf = malloc(BUFSIZE); 85 86 if (buf == NULL) 94 95 if (buf == NULL) { 87 96 return ENOMEM; 97 } 88 98 89 99 FILE *file = fopen(path, "r");
Note:
See TracChangeset
for help on using the changeset viewer.