c# - Predicting process end time -
I have a simple problem that I'm having more trouble than myself.
It's pretty straight forward: I have started the process once _start time
, and the current time. I also have the total number of records that need to be processed by _records
, and the current record number _current
.
How do I get a simple linear prophecy of the end times? I have ended up in different racks holes of tax and goods, but I think I am using some simple date time or timespace trickery,
Timespain Delta = DateTime. Now - _starttime; Float progress = (float) _Record / (float) _current;
Hmm actually looks pretty simple
TimeSpain timetancensoper = DateTime.Now - _start time; Double percentage dossoform = (double) _current / (double) _records; Timespace timetectingtital = TimetableEfar / PercentageSoffar; Date Timeout Time = _start Time Add (to take time);
This should work.
Updates:
According to MSDN, you can not split timepoints, but in that case you can use ticks: (I have # Is not the compiler, to check if this 100% syntax is correct)
timspan timetanksofer = date time.Now - _start time; Double percentage dossoform = (double) _current / (double) _records; DoubleTermatizingIntoolinatics = TimatankForTracks Tick / percent donsofar; Date Timeout Time = _start Time Adctix ((long) total to take time);
Comments
Post a Comment