Add reset for global stats and fix wpm for stats
This commit is contained in:
parent
a4e2062383
commit
c8d4b9ef81
3
main.go
3
main.go
|
@ -24,7 +24,7 @@ func finish(start time.Time, stat *db.Stat, finished bool) {
|
||||||
stat.Words = globalStat.Words
|
stat.Words = globalStat.Words
|
||||||
stat.Finished = finished
|
stat.Finished = finished
|
||||||
stat.CPM = float64(globalStat.Correct) / past.Minutes()
|
stat.CPM = float64(globalStat.Correct) / past.Minutes()
|
||||||
stat.WPM = float64(globalStat.Words+1) / past.Minutes()
|
stat.WPM = float64(globalStat.Words) / past.Minutes()
|
||||||
stat.TimeTaken = past.Milliseconds()
|
stat.TimeTaken = past.Milliseconds()
|
||||||
fmt.Printf("\r\n%s", colorizer.Colors.Reset())
|
fmt.Printf("\r\n%s", colorizer.Colors.Reset())
|
||||||
fmt.Print(past)
|
fmt.Print(past)
|
||||||
|
@ -176,5 +176,6 @@ outer:
|
||||||
log.Printf("ERROR: dbc.Create: %v", err)
|
log.Printf("ERROR: dbc.Create: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globalStat.Reset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user