Compute remaining time before call to first worker.

Fixes #373 

Move the calculation for when the phase will end to be before the worker is called.

This is the best pull request EVER.