just set a variable to $ctime when you start "timing" and when stopped you decrease the var from current $ctime

00:00:10 Start %start = $ctime = 10
00:10:15 End %end = $ctime = 615

duration = %end - %start = 605


Code:
//if ( khaled isgod ) echo yes | else echo no