Made the number of iterations easy to change, and the percentage indicator less spammy, it now overwrites itself as it goes.

develop
belal 2010-02-28 19:00:27 -05:00
parent c4cb3afd0b
commit f35472214a
1 changed files with 6 additions and 4 deletions

@ -29,15 +29,17 @@ int main (void)
} }
time(&start); time(&start);
for(uint32_t i = 0; i< 10000;i++) uint32_t iterations = 1000;
cout << "doing " << iterations << " iterations" << endl;
for(uint32_t i = 0; i< iterations;i++)
{ {
if(!DF.InitMap()) if(!DF.InitMap())
break; break;
DF.getSize(x_max,y_max,z_max); DF.getSize(x_max,y_max,z_max);
if((i % 100) == 0) if(i%(iterations/100) == 0)
{ {
int percentage = i / 100; int percentage = i / (iterations/100);
cout << percentage << " %" << endl; cout << "\b" << percentage << " %\xd"; // carridge return, not line feed, so percentage, less console spam :)
} }
for(uint32_t x = 0; x< x_max;x++) for(uint32_t x = 0; x< x_max;x++)
{ {