Does this not do what you are looking for?
Try setting the Script Timeout parameter.
If that still does not work and you do not want to mess with the global php.ini file you can also take a look into using a .user.ini instead.