blob: 2c304279262bb8c551e35726de6c3d042ae8a12a (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package progress
import "time"
// New creates one progress meter.
func New(opts Options) *Meter {
now := time.Now()
return &Meter{
writer: opts.Writer,
title: opts.Title,
total: opts.Total,
delay: max(opts.Delay, time.Duration(0)),
sparse: opts.Sparse,
throughput: opts.Throughput,
startedAt: now,
nextUpdateAt: now.Add(updateInterval),
nextThroughput: now.Add(throughputInterval),
lastPercent: -1,
}
}
|