Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/meokullu/calculateeta
- Owner: meokullu
- License: mit
- Created: 2022-11-23T19:04:54.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-01T13:54:43.000Z (4 months ago)
- Last Synced: 2024-11-08T22:06:01.772Z (about 1 month ago)
- Topics: eta, iterations, left-time, loops, multi-thread, single-thread, time, time-estimation
- Language: C#
- Homepage: https://meokullu.github.io/CalculateETA/
- Size: 367 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
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)