print minutes instead of seconds when timer > 60 sec

This commit is contained in:
mattes 2014-08-13 01:58:47 +02:00
parent 9eac2deef0
commit 9f00e6984b
1 changed files with 6 additions and 1 deletions

View File

@ -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) {