1
0
mirror of https://github.com/taigrr/go-fastping synced 2025-01-18 05:03:15 -08:00

Add numGoRoutines function

This commit is contained in:
Tatsushi Demachi 2015-09-03 05:04:17 +09:00
parent 06cac0fecd
commit d36728c9f3

View File

@ -43,6 +43,7 @@ import (
"log"
"math/rand"
"net"
"runtime"
"sync"
"syscall"
"time"
@ -105,6 +106,10 @@ func ipv4Payload(b []byte) []byte {
return b[hdrlen:]
}
func numGoRoutines() int {
return runtime.GOMAXPROCS(0) * 4
}
type packet struct {
bytes []byte
addr net.Addr