now calling avg time function