Here is a revised script:
It now lets the user specify a maximum samples value that overides those on each render target's kernel.
Additionally the user can specify a maximum time for the duration of the rendering process, whichever of these two conditions is met first determines the start of the next render target.
best
Mark.