Add measurement of algorithm speed