Loop num_runs times inside the measure function