Skip to content

It is used to know how much estimated time is left to finish a task.

License

Notifications You must be signed in to change notification settings

jonathanhecl/gotimeleft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoTimeLeft

Go Go Report Card License

It is used to know how much estimated time is left to finish a task.

Works like a progress bar too.

Example:

Image Image Image

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

About

It is used to know how much estimated time is left to finish a task.

Topics

Resources

License

Stars

Watchers

Forks

Languages