Add code to measure running time