mirror of https://github.com/status-im/migrate.git
print minutes instead of seconds when timer > 60 sec
This commit is contained in:
parent
9eac2deef0
commit
9f00e6984b
7
main.go
7
main.go
|
@ -125,7 +125,12 @@ func writePipe(pipe chan interface{}) {
|
|||
var timerStart time.Time
|
||||
|
||||
func printTimer() {
|
||||
fmt.Printf("\n%.4f seconds\n", time.Now().Sub(timerStart).Seconds())
|
||||
diff := time.Now().Sub(timerStart).Seconds()
|
||||
if diff > 60 {
|
||||
fmt.Printf("\n%.4f minutes\n", diff/60)
|
||||
} else {
|
||||
fmt.Printf("\n%.4f seconds\n", diff)
|
||||
}
|
||||
}
|
||||
|
||||
func createCmd(url, migrationsPath, name string) {
|
||||
|
|
Loading…
Reference in New Issue