calculate elapsed and processing time