adding time elapsed calculation