Updated timeElapsed function

Updated timeElapsed function