[cmd.gwstester] moved execution time to client management

This commit is contained in:
xdrm-brackets 2018-04-25 15:01:39 +02:00
parent 8cda08731f
commit 1ef8597742
1 changed files with 6 additions and 5 deletions

View File

@ -11,8 +11,6 @@ import (
func main() { func main() {
startTime := time.Now().UnixNano()
/* (1) Create listening socket /* (1) Create listening socket
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) Create 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) { func manageClient(sock net.Conn) {
startTime := time.Now().UnixNano()
defer sock.Close() defer sock.Close()
for { for {
@ -53,7 +51,10 @@ func manageClient(sock net.Conn) {
panic(err) panic(err)
} }
sock.Write([]byte("coucou")) break;
// sock.Write([]byte("coucou"))
} }
fmt.Printf("Elapsed: %1.1f us\n", float32(time.Now().UnixNano()-startTime)/1e3)
} }