created elapseTime method