CalculateETA is a project to calculate estimated time to arrive on loops whether it is in single-thread or multi-thread applications.
Release: Latest release
.NET CLI:
dotnet add package CalculateETA
CalculateETA has methods to calculate estimated time to finish on the loops. It calculates left count of the iteration and avarage passed time on the loop then multiply left count with avarage passed time. On multi-thread applications, it has internal counter that increases everytime methods are called. With using counter calculating left count of the loop and avarage passed time on the loop then multiply left count with avarage passed time.
CalculateETA is optimized for CPU-intense applications which methods are named Unsafe as suffix such as CalcUnsafe()
and NameETAUnsafe()
string CalcSTCPUIntense(int? index, int? totalIndex, double? totalElapsedTimeInMs)
{
return NameETAUnsafe(CalcETAUnsafe(index, totalIndex, totalElapsedTimeInMs));
}
string CalcSTBetterVisual(int? index, int? totalIndex, double? totalElapsedTimeInMs)
{
return NameETABetterVisual(CalcETA(index, totalIndex, totalElapsedTimeInMs));
}
string CalcMultiThread(uint? totalIndex, long? totalElapsedTicks)
{
return NameETA(CalcETAHighDense(totalIndex, totalElapsedTicks));
}
Reporting
// Getting instance of Reporting().
Reporting reporting = new Reporting();
// Calculating ETA
long? calcResult = CalcETA(index: i, totalIndex: total, timeSpan: sw.Elapsed);
// Adding result.
reporting.AddReport(calcResult);
Tip
To save reporting result easily, you can use EasySaver.TextFile.
dotnet add package EasySaver.TextFile
To check listed methods, example of output visit wiki page. CalculateETA Wiki
See Changelog
- Create an issue or check task list: Issues
This repository is licensed under the "MIT" license. See MIT license.
If you'd like to contribute, then contribute. contributing guide.
Twitter: Enes Okullu @enesokullu