https://github.com/jonathanhecl/gotimeleft
It is used to know how much estimated time is left to finish a task.
https://github.com/jonathanhecl/gotimeleft
golang left time timeleft
Last synced: over 1 year ago
JSON representation
It is used to know how much estimated time is left to finish a task.
- Host: GitHub
- URL: https://github.com/jonathanhecl/gotimeleft
- Owner: jonathanhecl
- License: mit
- Created: 2022-09-07T14:53:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-23T03:56:32.000Z (over 3 years ago)
- Last Synced: 2023-07-26T15:15:17.190Z (almost 3 years ago)
- Topics: golang, left, time, timeleft
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoTimeLeft
[](https://github.com/jonathanhecl/gotimeleft/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/jonathanhecl/gotimeleft)
[](./LICENSE)
> It is used to know how much estimated time is left to finish a task.
>
> Works like a progress bar too.
## Example:



## How to install
> go get github.com/jonathanhecl/gotimeleft
## How to use
```
timeleft := gotimeleft.Init(100) // Total 100, value 0
...
timeleft.Reset(200) // Reset to total 200, value 0
...
timeleft.Step(10) // value +10
...
timeleft.Value(50) // value 50
...
timeleft.GetProgressValues() // => 55/100 string
timeleft.GetProgress(2) // => 55.33% string with 2 decimals
timeleft.GetProgressBar(30) // [==============>...............] string with 30 chars
timeleft.GetFloat64() // => 0.55 float64
timeleft.GetPerSecond() // => 5.55 float64 per second
timeleft.GetTimeLeft() // => 0.5ms time.Duration
timeleft.GetTimeSpent() // => 2s time.Duration
```