If there is unnecessary delay in presenting a charge to a grand jury or in filing an information against a defendant who has been held to answer to a circuit court, or if there is unnecessary delay in bringing a defendant to trial, a court may dismiss his indictment, information or complaint.
SDCL 23A-44-3