Request delays support added
This commit is contained in:
@ -5,7 +5,9 @@ import (
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/fpfeng/httpcache"
|
||||
"github.com/geziyor/geziyor"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestGeziyor_Simple(t *testing.T) {
|
||||
@ -69,3 +71,12 @@ func TestGeziyor_Concurrent_Requests(t *testing.T) {
|
||||
})
|
||||
gez.Start()
|
||||
}
|
||||
|
||||
func TestRandomDelay(t *testing.T) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
delay := time.Millisecond * 1000
|
||||
min := float64(delay) * 0.5
|
||||
max := float64(delay) * 1.5
|
||||
randomDelay := rand.Intn(int(max-min)) + int(min)
|
||||
fmt.Println(time.Duration(randomDelay))
|
||||
}
|
||||
|
Reference in New Issue
Block a user