Added code for time measure