flush console to ensure progress output

This commit is contained in:
ari melody 2024-02-12 02:14:41 +00:00
parent 247a66cad1
commit a258b4bbea
Signed by: ari
GPG key ID: CF99829C92678188

7
main.c
View file

@ -28,11 +28,16 @@ int main() {
while (getchar() != '\n'); while (getchar() != '\n');
printf("please wait"); printf("please wait");
fflush(stdout);
unsigned long long int* wtf = (unsigned long long int*) malloc(size); unsigned long long int* wtf = (unsigned long long int*) malloc(size);
for (unsigned long long int i = 0; i < size / sizeof(long long int); i++) { for (unsigned long long int i = 0; i < size / sizeof(long long int); i++) {
wtf[i] = 0x80085; wtf[i] = 0x80085;
if (i > 0 && i % (1024 * 1024 * 1024 / sizeof(long long int)) == 0) printf("."); if (i > 0 && i % (1024 * 1024 * 1024 / sizeof(long long int)) == 0) {
printf(".");
fflush(stdout);
}
} }
printf("\n"); printf("\n");