HTTP load generator, ApacheBench (ab) replacement
Go
Use time.NewTicker() which returns a stoppable ticker
JBD18a4569ad479
diff --git a/requester/requester.go b/requester/requester.goindex 652e460..6ee2986 100644--- a/requester/requester.go+++ b/requester/requester.go@@ -208,7 +208,9 @@ func (b *Work) makeRequest(c *http.Client) {func (b *Work) runWorker(client *http.Client, n int) {var throttle <-chan time.Timeif b.QPS > 0 {- throttle = time.Tick(time.Duration(1e6/(b.QPS)) * time.Microsecond)+ ticker := time.NewTicker(time.Duration(1e6/(b.QPS)) * time.Microsecond)+ defer ticker.Stop()+ throttle = ticker.C}if b.DisableRedirects {