From e2bef5963e9f3eba7bc11def64b185b2a603e1f4 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 25 Apr 2018 08:02:58 +0200 Subject: [PATCH] [cmd.client | cmd.server] fixed time execution output issue --- src/git.xdrm.io/schastsp/cmd/client/client.go | 8 ++++---- src/git.xdrm.io/schastsp/cmd/server/server.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/git.xdrm.io/schastsp/cmd/client/client.go b/src/git.xdrm.io/schastsp/cmd/client/client.go index 82cfba2..98bfd71 100644 --- a/src/git.xdrm.io/schastsp/cmd/client/client.go +++ b/src/git.xdrm.io/schastsp/cmd/client/client.go @@ -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 } diff --git a/src/git.xdrm.io/schastsp/cmd/server/server.go b/src/git.xdrm.io/schastsp/cmd/server/server.go index 211d7ea..7c48561 100644 --- a/src/git.xdrm.io/schastsp/cmd/server/server.go +++ b/src/git.xdrm.io/schastsp/cmd/server/server.go @@ -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 }