I'm using Docker on Mac OS.
Engine: 18.09.0 Image: php:7-fpm
I wrote a script:
while(true) {$start = microtime(true); usleep(1000000); echo (microtime(true) - $start) . "
";}
And I see the output:
1.0008330345154
1.0003759860992
1.0002889633179
1.0007400512695
1.0017168521881
1.0014839172363
1.0003681182861
0.96751689910889
1.0006330013275
1.0007119178772
1.0007698535919
1.0011031627655
1.0003590583801
1.0012609958649
1.0004398822784
1.0004119873047
When I run the script on the host machine it works fine. Any idea why it happens? Probably something wrong with microtime accuracy?
UPD: It happens every 30s. Probably Docker does something. Time synching?