Refactor code for temporization.

The temporization functions now use the elapsed time versions in order
to reduce the code duplication.