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"
 | 
						"log"
 | 
				
			||||||
	"math/rand"
 | 
						"math/rand"
 | 
				
			||||||
	"net"
 | 
						"net"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
	"sync"
 | 
						"sync"
 | 
				
			||||||
	"syscall"
 | 
						"syscall"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
@ -105,6 +106,10 @@ func ipv4Payload(b []byte) []byte {
 | 
				
			|||||||
	return b[hdrlen:]
 | 
						return b[hdrlen:]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func numGoRoutines() int {
 | 
				
			||||||
 | 
						return runtime.GOMAXPROCS(0) * 4
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type packet struct {
 | 
					type packet struct {
 | 
				
			||||||
	bytes []byte
 | 
						bytes []byte
 | 
				
			||||||
	addr  net.Addr
 | 
						addr  net.Addr
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user