Only report success rate and average time in benchmark summary
This commit is contained in:
parent
14eb8533e6
commit
07c1fc7a0f
22
main.c
22
main.c
@ -84,31 +84,15 @@ int main(void)
|
|||||||
const double tot_micros = 1e6 * (double)secs + (double)nanos / 1e3;
|
const double tot_micros = 1e6 * (double)secs + (double)nanos / 1e3;
|
||||||
const double avg_micros = tot_micros / NPUZZLES;
|
const double avg_micros = tot_micros / NPUZZLES;
|
||||||
|
|
||||||
unsigned error = 0, incomplete = 0, incorrect = 0, solved = 0;
|
unsigned solved = 0;
|
||||||
for (i = 0; i < NPUZZLES; ++i) {
|
for (i = 0; i < NPUZZLES; ++i) {
|
||||||
if (!res[i]) {
|
if (res[i] && check(&puzzles[i]) == SOLVED)
|
||||||
++error;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
switch (check(&puzzles[i])) {
|
|
||||||
case INCOMPLETE:
|
|
||||||
++incomplete;
|
|
||||||
break;
|
|
||||||
case INCORRECT:
|
|
||||||
++incorrect;
|
|
||||||
break;
|
|
||||||
case SOLVED:
|
|
||||||
++solved;
|
++solved;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("\n SUMMARY\n =======");
|
puts("\n SUMMARY\n =======");
|
||||||
|
printf("Success rate: %.0lf%%\n", 1e2 * (double)solved / NPUZZLES);
|
||||||
printf("Average time: %.3lf µs\n", avg_micros);
|
printf("Average time: %.3lf µs\n", avg_micros);
|
||||||
printf("Solved: %4u/%u\n", solved, NPUZZLES);
|
|
||||||
printf("Incomplete: %4u/%u\n", incomplete, NPUZZLES);
|
|
||||||
printf("Incorrect: %4u/%u\n", incorrect, NPUZZLES);
|
|
||||||
printf("Solver error: %4u/%u\n", error, NPUZZLES);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user