Php Time controled execution

Is there a way to control php aplications by time? for example if some part of a For takes more than 10 seconds continue with the next number of the loop