Uhm, yeah, you could use Perl. But determining whether something takes "too long" isn't simple. There's a lot
that is involved when requesting a URL. Your machine.
Your network. The network between you and the server.
The network at the server side. The load on the server.
Etc, etc. Not all of them are under the control of the
server. side.
The hardest problem is figuring out what is "too long" and
whose fault it is.