[cmd.gwstester] moved execution time to client management
This commit is contained in:
parent
8cda08731f
commit
1ef8597742
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue