implemented runnintTime() to measure running time