Enhanced function to calculate average, minimum and maximum time between sensor readings