finding average time