Skip to content
Enes Okullu edited this page Apr 14, 2024 · 10 revisions

CalculateETA has several methods for multi thread applications. All methods calculates left count of the loop, average passed time and multiply of left count and average passed time then returns it.

CalcETA by total elapsed time in milliseconds.

4

CalcETA(int? totalIndex, long? totalElapsedTimeInMs);
CalcETAUnsafe(int? totalIndex, long? totalElapsedTimeInMs);
CalcETA(uint? totalIndex, long? totalElapsedTimeInMs);
CalcETAUnsafe(uint? totalIndex, long? TotalElapsedTimeInMs);

Returns null if any of parameter is null or returns estimated left time in milliseconds (long?)

  • int?/uint? index: Current index of loop. Index must not be zero.
  • long? totalElapsedTimeInMs: Passed time of loop in milliseconds.

CalcETA by total elapsed time in ticks.

5

CalcETA(int? totalIndex, long? totalElapsedTicks, long? frequency);
CalcETAUnSafe(int? totalIndex, long? totalElapsedTicks, long? frequency);
CalcETA(uint? totalIndex, long? totalElapsedTicks, long? frequency);
CalcETAUnsafe(uint? totalIndex, long? totalElapsedTicks, long? frequency)

Returns null if any of parameter is null or returns estimated left time in milliseconds (long?)

  • int?/uint? index: Current index of loop. Index must not be zero.
  • long? totalElapsedTicks: Passed ticks of loop.
  • long? frequency: Tick of frequency. Frequency must not be zero.

CalcETA by total elapsed time in TimeSpan.

6

CalcETA(int? totalIndex, TimeSpan? timeSpan);
CalcETAUnsafe(int? totalIndex, TimeSpan? timeSpan);
CalcETA(uint? totalIndex, TimeSpan? timeSpan);
CalcETAUnsafe(uint? totalIndex, TimeSpan? timeSpan);

Returns null if any of parameter is null or returns estimated left time in milliseconds (double?)

  • int?/uint? index: Current index of loop. Index must not be zero.
  • TimeSpan? timeSpan: Passed time of loop in TimeSpan format.

Output

  • TimeSpanETA(90000) => (TimeSpan)00:01:30
  • NumberFormatETA(90000) => "0:1:30"
  • NameETA(90000) => "1 minute(s) and 30 second(s)" (recommended for high-CPU-intense algorithm)
  • NameETABetterVisual(90000) => "1 minute and 30 seconds"(recommended for low-CPU-intense algorithm in order to offer better visual output)
Clone this wiki locally