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

SleepDeferrer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrentTime() 0 4 1
A sleep() 0 4 1
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