Add for time counter to caculate total running time