When something takes a long time to run, it can be hard to debug because you can't finish a page to get a profiler trace out of it, and adjusting all the time limits and timeouts is a big pain.
It looks like we can use a tick function to dump a trace after a set number of seconds and terminate.