diff --git a/cmd/gwstester/tester.go b/cmd/gwstester/tester.go index 21a382d..c4a3c23 100644 --- a/cmd/gwstester/tester.go +++ b/cmd/gwstester/tester.go @@ -11,8 +11,6 @@ import ( func main() { - startTime := time.Now().UnixNano() - /* (1) Create listening socket ---------------------------------------------------------*/ /* (1) Create socket */ @@ -36,12 +34,12 @@ func main() { } - fmt.Printf("Elapsed: %d ns\n", time.Now().UnixNano()-startTime) - } func manageClient(sock net.Conn) { + startTime := time.Now().UnixNano() + defer sock.Close() for { @@ -53,7 +51,10 @@ func manageClient(sock net.Conn) { panic(err) } - sock.Write([]byte("coucou")) + break; + // sock.Write([]byte("coucou")) } + + fmt.Printf("Elapsed: %1.1f us\n", float32(time.Now().UnixNano()-startTime)/1e3) }