func (b *Bar) AppendElapsed() *Bar {
	b.AppendFunc(func(b *Bar) string {
		return strutil.PadLeft(b.TimeElapsedString(), 5, ' ')
	})
	return b
}
AppendElapsed appends the time elapsed the be progress bar
package uiprogress
import (
	"bytes"
	"errors"
	"fmt"
	"sync"
	"time"
	"github.com/gosuri/uiprogress/util/strutil"
)
var (
	Fill byte = '='
	Head byte = '>'
	Empty byte = '-'
	LeftEnd byte = '['
	RightEnd byte = ']'
	Width = 70
	ErrMaxCurrentReached = errors.New("errors: current value is greater total value")
)
type Bar struct {
	Total int
	LeftEnd byte
	RightEnd byte
	Fill byte
	Head byte
	Empty byte
	TimeStarted time.Time
	Width int
	timeElapsed time.Duration
	current     int
	mtx *sync.RWMutex
	appendFuncs  []DecoratorFunc
	prependFuncs []DecoratorFunc
}
type DecoratorFunc func(b *Bar) string
func NewBar(total int) *Bar {
	return &Bar{
		Total:    total,
		Width:    Width,
		LeftEnd:  LeftEnd,
		RightEnd: RightEnd,
		Head:     Head,
		Fill:     Fill,
		Empty:    Empty,
		mtx: &sync.RWMutex{},
	}
}
func (b *Bar) Set(n int) error {
	b.mtx.Lock()
	defer b.mtx.Unlock()
	if n > b.Total {
		return ErrMaxCurrentReached
	}
	b.current = n
	return nil
}
func (b *Bar) Incr() bool {
	b.mtx.Lock()
	defer b.mtx.Unlock()
	n := b.current + 1
	if n > b.Total {
		return false
	}
	var t time.Time
	if b.TimeStarted == t {
		b.TimeStarted = time.Now()
	}
	b.timeElapsed = time.Since(b.TimeStarted)
	b.current = n
	return true
}
func (b *Bar) Current() int {
	b.mtx.RLock()
	defer b.mtx.RUnlock()
	return b.current
}
func (b *Bar) AppendFunc(f DecoratorFunc) *Bar {
	b.mtx.Lock()
	defer b.mtx.Unlock()
	b.appendFuncs = append(b.appendFuncs, f)
	return b
}
func (b *Bar) AppendCompleted() *Bar {
	b.AppendFunc(func(b *Bar) string {
		return b.CompletedPercentString()
	})
	return b
}