change method to calculate elapsed time