You can measure the time directly in your C program like
On my laptop it for calculating roots with rt=2, rt=50000, rt=99999 it needs 4.8s, 2.8s, 2.5s. So for a complete loop it would need about average * iterations = 3.3s * 100000 = 330000s =54 hours.
So if you PC is not much faster, it would need more than 2 days to complete the loop
The 99999th root of a 78MB number is a number with about 2000 decimal digits length which is much larger than your condition to break (999999) which has 6 digits length. So if my calculation is right your loop will always run a 100000 times.
Also to see the progress of you loop you could print in every iteration a log with then current number of rt.
Code:
#include <time.h>[...]clock_t start, end;double time_used;start = clock();// here what to be measured, like calculating a rootend = clock();time_used = ((double)(end - start)) / CLOCKS_PER_SEC;printf("Time taken: %f\n", time_used);So if you PC is not much faster, it would need more than 2 days to complete the loop
The 99999th root of a 78MB number is a number with about 2000 decimal digits length which is much larger than your condition to break (999999) which has 6 digits length. So if my calculation is right your loop will always run a 100000 times.
Also to see the progress of you loop you could print in every iteration a log with then current number of rt.
Statistics: Posted by blackbird — 2024-09-28 19:29