Completed
Push — master ( 1a09f9...c7cb86 )
by Sebastian
01:41
created

SleepDeferrer::getCurrentTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\GuzzleRateLimiterMiddleware;
4
5
class SleepDeferrer implements Deferrer
6
{
7
    public function getCurrentTime(): int
8
    {
9
        return round(microtime(true) * 1000);
10
    }
11
12
    public function sleep(int $milliseconds)
13
    {
14
        sleep($milliseconds / 1000);
15
    }
16
}
17