Any such contest, except as to the election of presidential electors, shall not be commenced until after the official canvass of the returns as to the office, nomination, position, or question involved; and must be commenced within ten days thereafter, except that where upon a recount there is a determination that is contrary to the result as pronounced on the official returns, such contest may be started within five days after such pronouncement of such result of such recount.
SDCL 12-22-5