Async possible?

if i want to ping many websites at once (using requests library) it takes a long time.. is it possible that it first pings web1, then withoutnwaiting for output, pings 2 then waits till both gets pinged?

Current code: how do i change it?

Takes approx 0.5 to 0.8 or even 1 second to complete 1 loop of while true excluding time.sleep

You are viewing a single comment. View All
Answered by InvisibleOne [earned 5 cycles]
View Answer

You can use threading, like this:

also never ever ping a website every half second -- that's on the verge of making the website crash. Make it do every 5 minutes.


@Coder100 oh.. mat1 pinger pings every 5 secs, so i didnt think this will happen xD thx!