Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meokullu/calculateeta

Calculate left time to finish iteration.
https://github.com/meokullu/calculateeta

eta iterations left-time loops multi-thread single-thread time time-estimation

Last synced: about 1 month ago
JSON representation

Calculate left time to finish iteration.

Awesome Lists containing this project

README

        

## CalculateETA
[![CalculateETA](https://img.shields.io/nuget/v/CalculateETA.svg)](https://www.nuget.org/packages/CalculateETA/) [![CalculateETA](https://img.shields.io/nuget/dt/CalculateETA.svg)](https://www.nuget.org/packages/CalculateETA/) [![License](https://img.shields.io/github/license/meokullu/CalculateETA.svg)](https://github.com/meokullu/CalculateETA/blob/master/LICENSE)

CalculateETA is a project to calculate estimated time to arrive on loops whether it is in single-thread or multi-thread applications.

![CalculateETA](https://github.com/meokullu/CalculateETA/assets/4971757/006959d8-9736-4e67-a42a-1afd13e267a5)

### How to download
Release: [Latest release](https://github.com/meokullu/CalculateETA/releases/latest)

[Download on NuGet gallery](https://www.nuget.org/packages/CalculateETA/)

.NET CLI:
```
dotnet add package CalculateETA
```

### Description
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()`

### Example Usage
```
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](https://github.com/meokullu/CalculateETA/wiki)

### Version History
See [Changelog](https://github.com/meokullu/CalculateETA/blob/master/CHANGELOG.md)

### Task list
* Create an issue or check task list: [Issues](https://github.com/meokullu/CalculateETA/issues)

### Licence
This repository is licensed under the "MIT" license. See [MIT license](https://github.com/meokullu/CalculateETA/blob/master/LICENSE).

### Authors & Contributing
If you'd like to contribute, then contribute. [contributing guide](https://github.com/meokullu/CalculateETA/blob/master/CONTRIBUTING.md).

[![Contributors](https://contrib.rocks/image?repo=meokullu/CalculateETA)](https://github.com/meokullu/CalculateETA/graphs/contributors)

### Help
Twitter: Enes Okullu [@enesokullu](https://twitter.com/EnesOkullu)