progress bar and rename function measure accuracy

This commit is contained in:
Jakob Stornig 2023-09-21 11:22:31 +02:00
parent f10814c56c
commit e0c46fc46a
7 changed files with 45 additions and 9 deletions

20
util.c Normal file
View file

@ -0,0 +1,20 @@
//
// Created by jakob on 21.09.2023.
//
#include "util.h"
#include <stdio.h>
void updateBar(int percent_done){
const int BAR_LENGTH = 30;
int numChar = percent_done * BAR_LENGTH / 100;
printf("\r[");
for(int i = 0; i < numChar; i++){
printf("#");
}
for(int i = 0; i < BAR_LENGTH - numChar; i++){
printf(".");
}
printf("] (%d%%)", percent_done);
fflush(stdout);
}