Embedded timer into algorithm.