File: simple.go

package info (click to toggle)
golang-github-thcyron-uiprogress 0.0~git20171218.25e98ff-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,820 kB
  • sloc: makefile: 15
file content (20 lines) | stat: -rw-r--r-- 348 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main

import (
	"time"

	"github.com/gosuri/uiprogress"
)

func main() {
	uiprogress.Start()            // start rendering
	bar := uiprogress.AddBar(100) // Add a new bar

	// optionally, append and prepend completion and elapsed time
	bar.AppendCompleted()
	bar.PrependElapsed()

	for bar.Incr() {
		time.Sleep(time.Millisecond * 20)
	}
}