For comparison purposes, the default limit on desktop Firefox is 10 seconds, I believe. And I'm pretty sure this is consecutive time, not total time. It is simply to prevent crashes if the Javascript gets stuck in an infinite loop.
Edit: In addition, based off what I've read in my short Google search on Firefox's timeout, it was once 5 seconds. (But now the default is 10). The difference between Firefox and the iPhone browser will most likely be that in Firefox this setting is customizable (but you have to go to about:config and change it manually) and Firefox doesn't simply halt the script, but shows a dialog telling the user that a script is running to slow and asking whether to stop it or not. If the user decides not to stop it, and it is an endless loop, Firefox would (this is an educated guess) hang. As Apple wants the iPhone to be stable, they don't want to give the user a choice to do something which has a potential to crash the system.