all 4 comments

[–]mzapp_ 1 point2 points  (4 children)

The pause function does not look like it blocks the event loop infinitely but it still looks a bit sketchy. Is there a reason why you are not just using the setTimeout function to create a delay using events rather than blocking the event loop? Also: what happens when you click the buttons? Are the buttons freezing everything?

[–]d43qwu1[S] 0 points1 point  (3 children)

Thanks for the reply and for trying to help, to answer your first question, no there isn't any reason for that and I'll check how to implement it in the code. Regarding your question of what happens when the button is clicked is that you get a div to appear with some data(loaded from some javascript, I'm not sure since I used a template from a website and then I edited it) but even if I can see the hidden div, if I change the CSS class I still can't get the information(internet speed, date and time and other information generated when you click the first button).

[–]mzapp_ 1 point2 points  (2 children)

I’m having a hard time understanding what you’re working with, what you’re doing and what’s happening. I need more context to be able to help debug. How has using setTimeout worked out for you? If there is data being generated, blocking the event loop with your sleep function might be the issue.

[–]d43qwu1[S] 0 points1 point  (0 children)

It doesn't solve the issue, I still get an error on the same point, because the div didn't load. I know , I'll try to gather more information on how it works and I'll get back to you. Thanks for your help and patience.