Skip to content

Commit

Permalink
Use real time instead of tick count
Browse files Browse the repository at this point in the history
  • Loading branch information
bastengao committed Mar 11, 2020
1 parent d1588bb commit c8910bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (page *ScanningPage) Show() {
dots := []byte{'.', '.', '.', '.', '.', '.'}
spaces := []byte{' ', ' ', ' ', ' ', ' ', ' '}
count := 0
start := time.Now()
for {
select {
case <-tick:
Expand All @@ -75,7 +76,7 @@ func (page *ScanningPage) Show() {
s := string(dots[0:p])
b := string(spaces[0:(6 - p)])
page.app.QueueUpdateDraw(func() {
modal.SetText(fmt.Sprintf("Scanning %s%s\n\nTime %ds", s, b, count/2))
modal.SetText(fmt.Sprintf("Scanning %s%s\n\nTime %ds", s, b, int(time.Now().Sub(start).Seconds())))
})
case <-page.done:
return
Expand Down

0 comments on commit c8910bb

Please sign in to comment.