[cmd.client | cmd.server] fixed time execution output issue

This commit is contained in:
xdrm-brackets 2018-04-25 08:02:58 +02:00
parent 257ec355c9
commit e2bef5963e
2 changed files with 8 additions and 8 deletions

View File

@ -86,10 +86,10 @@ func main(){
msElapsed := float64(usElapsed / 1e3)
sElapsed := float64(msElapsed / 1e3)
if sElapsed >= 1 { fmt.Errorf("executed in %.3f s\n", sElapsed)
} else if msElapsed >= 1 { fmt.Errorf("executed in %.3f ms\n", msElapsed)
} else if usElapsed >= 1 { fmt.Errorf("executed in %.3f us\n", usElapsed)
} else if nsElapsed >= 1 { fmt.Errorf("executed in %.3f ns\n", nsElapsed) }
if sElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f s\n", sElapsed) )
} else if msElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f ms\n", msElapsed) )
} else if usElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f us\n", usElapsed) )
} else if nsElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f ns\n", nsElapsed) ) }
return
}

View File

@ -74,10 +74,10 @@ func main(){
msElapsed := float64(usElapsed / 1e3)
sElapsed := float64(msElapsed / 1e3)
if sElapsed >= 1 { fmt.Errorf("executed in %.3f s\n", sElapsed)
} else if msElapsed >= 1 { fmt.Errorf("executed in %.3f ms\n", msElapsed)
} else if usElapsed >= 1 { fmt.Errorf("executed in %.3f us\n", usElapsed)
} else if nsElapsed >= 1 { fmt.Errorf("executed in %.3f ns\n", nsElapsed) }
if sElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f s\n", sElapsed) )
} else if msElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f ms\n", msElapsed) )
} else if usElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f us\n", usElapsed) )
} else if nsElapsed >= 1 { os.Stderr.WriteString( fmt.Sprintf("executed in %.3f ns\n", nsElapsed) ) }
return
}