add test mode, -times option, -avg option