Open nemohan opened 10 months ago
Use following test code: func TestSlack2(t *testing.T) { rl := New(1, WithSlack(2)) // per second, some slack. rl.Take() // Initialize. time.Sleep(time.Second * 4) for i := 0; i < 100; i++ { rl.Take() fmt.Printf("%d\n", time.Now().Unix()) } } I got those output: 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 ....
func TestSlack2(t *testing.T) { rl := New(1, WithSlack(2)) // per second, some slack. rl.Take() // Initialize. time.Sleep(time.Second * 4) for i := 0; i < 100; i++ { rl.Take() fmt.Printf("%d\n", time.Now().Unix()) } }
Use following test code:
func TestSlack2(t *testing.T) { rl := New(1, WithSlack(2)) // per second, some slack. rl.Take() // Initialize. time.Sleep(time.Second * 4) for i := 0; i < 100; i++ { rl.Take() fmt.Printf("%d\n", time.Now().Unix()) } }
I got those output: 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 1702546953 ....