I've got some timers that measure the time to execute code.
DateTime startTimeFunctionTotal = DateTime.Now;
for (int i = 0; i < array.Count; i++) {
DateTime startTimeFunction = DateTime.Now;
//some code here
DateTime stopTimeFunction = DateTime.Now;
TimeSpan durationTimeFunction = stopTimeFunction - startTimeFunction ;
}
DateTime stopTimeFunctionTotal = DateTime.Now;
TimeSpan durationTimeFunctionTotal = stopTimeFunctionTotal - startTimeFunctionTotal ;
It's allowed (even better) if the predicted time changes according to more data (every loop there is more data so prediction should be more accurate).
I would like to give user a predicted time of finish (both time like 15 minutes, and 10:56).