loop.
My final goal is to do a ping test for 255 IP addresses. So basically my
for loop is something like
i := 0
for i < 255 {
i++
commandLinePing := fmt.Sprint("ping 10.11.204." + string(i))
err := exec.Command("bash", "-c", commandLinePing).Run()
if err != nil {
}
}
So, the loops works well. But I would like to parallelize every 255
iterations, so that all 255 execute in the time of 1 (or so).
Any good way to do so ? To considerably reduce the execution time ?
Of course, this is a ping test so I need to listen for the reply from these
255 IPs. So, at the end, I need to wait until the last thread is finished.
Thank you very much.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.