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:
parent
06cac0fecd
commit
d36728c9f3
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user