measuring the elapsed time