Addition of simple routines to calculate min/max/avg time in the main loop for efficiency checking purposes.