diff options
-rwxr-xr-x | zttest.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -13,11 +13,12 @@ static int pass = 0; static float best = 0.0; static float worst = 100.0; +static float total = 0.0; void hup_handler(int sig) { printf("\n--- Results after %d passes ---\n", pass); - printf("Best: %f -- Worst: %f\n", best, worst); + printf("Best: %f -- Worst: %f -- Average: %f\n", best, worst, pass ? total/pass : 100.00); exit(0); } @@ -71,6 +72,7 @@ int main(int argc, char *argv[]) if (score < worst) worst = score; printf("%f%% ", score); + total += score; fflush(stdout); count = 0; pass++; |