wire-elements / wire-spy

WireSpy—a sleek new debug bar for Livewire
https://wire-elements.dev/blog/announcing-wirespy-a-sleek-new-debug-bar-for-livewire
MIT License
388 stars 13 forks source link

implicit cast spamming logs when sleeping #26

Open ainesophaur opened 2 weeks ago

ainesophaur commented 2 weeks ago

My console logs started to get spammed with the following message:

Implicit conversion from float 0.25 to int loses precision in vendor/wire-elements/wire-spy/src/SupportHotReloading.php on line 112

The code causing the issue is

sleep(.25);

I fixed it locally by changing the sleep function to usleep

usleep(25000);
Cegem-360 commented 1 week ago

Yes, this issue is solved by me and Merged into code, but i miss calculate the value instead of 250 => 250000 = 0.25 second like sleep(0.25)

ainesophaur commented 1 week ago

I checked the update and I see you're doing

usleep(250) which will now run 4000 times a second (0.0025 seconds).. just making sure that was the intention as that seems a bit high and could probably be increased to have fewer cycles.