add code to collect time elapsed