This calculation of elapsed time should be pulled out into a function on it's own.  A function that does parsing in addition to math-y stuff is doing too much.