Added number of runs measurement, and a measurement completed function