Skip to content

Not waiting sufficient time #20

@udf2457

Description

@udf2457
$throttle = new Stiphle\Throttle\LeakyBucket;
for ($i = 1; $i <= 100; $i++) {
$throttle->throttle('x', 2, 20000).PHP_EOL;
echo time().PHP_EOL;
}

Gives an output of:

1552774090
1552774090
1552774100
1552774110
1552774120
1552774130

1552774100-1552774090=10, so we're doing more than 2 in a 20 second period ?
Same goes fo the rest, they go up in to second increments 00,10,20,30....

(PHP PHP 7.2.16 on Linux)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions