[cmd.client | cmd.server] fixed time execution output issue
This commit is contained in:
parent
257ec355c9
commit
e2bef5963e
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue