Skip to content

First/second call to throttle not really trottled? #6

@ghost

Description

Hi,

I've got a question about the TimeWindow throttler:

With the following piece of code:

$throttler = new TimeWindow();
while(true) {
            $throttler->throttle('key', 1, 1000);
            echo microtime(true) . "\n";
}

The following outcome appears

1431528461.287
1431528461.5689
1431528462.5681
1431528463.5691

The first and second call are less than a second apart, but I would expect that every call is (at least) a second apart from the next/previous..

Can you explain why this happens?

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