
470 P.2d 132 (1970)
Willie Earl McGEE, Appellant,
v.
SHERIFF, CLARK COUNTY, Nevada, Respondent.
No. 6154.
Supreme Court of Nevada.
June 4, 1970.
*133 Wiener, Goldwater & Galatz and Herbert L. Waldman, Las Vegas, for appellant.
Harvey Dickerson, Atty. Gen., Carson City, George E. Franklin, Jr., Dist. Atty., and Larry C. Johns, Deputy Dist. Atty., Las Vegas, for respondent.

OPINION
THOMPSON, Justice.
On May 19, 1967, McGee was charged by criminal complaint with having committed the crime of robbery, and was arrested forthwith. A preliminary examination was never held on that charge, nor was such examination waived. In September 1967, the district court granted the defendant's petition for a writ of habeas corpus, and he was discharged from custody. The order granting the writ was premised upon the state's failure to prosecute the case with reasonable speed. The state did not appeal from that adverse ruling. Instead, the prosecutor filed another criminal complaint on December 13, 1967 charging McGee with the same offense. He was eventually arrested in another state and returned to Nevada. A timely preliminary hearing was held on the second criminal complaint in December 1968, and the magistrate ordered that McGee stand trial in the district court. He then commenced this habeas proceeding contending that his right to a speedy trial was violated. The district court denied relief, and this appeal followed.
Two contentions are pressed: first, that his constitutional right to a speedy trial forbids prosecution of the second complaint, just as it required his discharge on the first one; second, that by failing to appeal from the September 1967 order releasing him from custody, the state is barred from commencing a new proceeding against him for the same offense. We turn to consider these contentions.
1. The Sixth Amendment right to a speedy trial extends to state criminal cases. Klopfer v. North Carolina, 386 U.S. 213, 87 S.Ct. 988, 18 L.Ed.2d 1 (1967). Our statutory time directives governing the progress of a criminal case serve as a guide in deciding a speedy trial issue. Stabile v. Justice's Court, 83 Nev. 393, 432 P.2d 670 (1967). This constitutional right recognizes that the pendency of a criminal charge may subject an accused to public scorn, deprive him of employment and curtail his speech and associations. It affords protection against these consequences as well as against unreasonable detention before trial. Klopfer v. North Carolina, supra. It is intended to spare an accused those penalties and disabilities  incompatible with the presumption of innocence  that may spring from delay in the criminal process. Dickey v. Florida, 398 U.S. 30, 90 S.Ct. 1564, 26 L.Ed.2d 26 (May 25, 1970). A violation of this fundamental right entitles an accused to discharge from custody or restraint. However, the violation is not necessarily to be given the effect of an acquittal. It is for this reason that the right must be asserted before trial, or it is waived. Oberle v. Fogliani, 82 Nev. 428, 420 P.2d 251 (1966). An attempt to invoke it following trial and conviction will not be honored. In short, this constitutional right possesses little, if any, relevance to the issue of guilt. Rather, it is designed to afford protection against the mentioned consequences which inevitably flow from the failure to prosecute with reasonable speed. Our legislature has, therefore, directed that one who has been discharged upon habeas corpus may afterwards be committed for the same offense by legal order or process.[1] A previous illegal detention *134 does not preclude a later valid detention, preliminary examination and commitment. Victoria v. Young, 80 Nev. 279, 392 P.2d 509 (1964). Of course, the subsequent prosecution must be commenced within the period of limitations, NRS 171.080-171.100. The subsequent prosecution may also be forbidden if the original proceeding was dismissed due to the willful failure of the prosecutor to comply with important procedural rules  a rare circumstance, but one that can occur. Maes, et al. v. Sheriff, 86 Nev. ___, 468 P.2d 332, (1970). Neither of these exceptions apply to the case at hand.
The interests of all are thus accommodated. An accused is protected against unreasonable delay in bringing him to trial and may secure his release via habeas. On the other hand, society is protected against the release of one who may be proven guilty, by permitting a refiling of the charge within the period of limitations. This is precisely what happened here. We hold that the appellant has not been denied his Sixth Amendment right to a speedy trial. That right was honored when the district court ordered his release upon the first complaint, and the proceeding on the second complaint has progressed without unreasonable delay.
2. The right to appeal an order of the district court granting a petition for habeas corpus was expressly granted in 1953, almost one hundred years after adoption of the statute permitting the refiling of a charge following release on habeas.[2] The appellant contends that appeal is the sole remedy available to the state and displaced refiling of the charge. The 1953 statute does not repeal the earlier one, either expressly or by implication. The dual remedies may coexist and are not basically inconsistent. There is no valid objection to the existence of two courses of action for the state, refiling or appeal.
Refiling normally will be utilized when the order granting habeas relief rests upon a technical deficiency in the process, warrant or commitment, or perhaps, when the state, having ample evidence to hold the accused for trial, neglected to offer enough to satisfy the court. Refiling in such circumstances will move the case along without the delay attending appeal  an important consideration in criminal matters. On the other hand, the prosecutor may select appellate review to establish a point of law for future guidance and to correct what he considers to be a significant or recurring district court error. If successful, the district court order would be voided, and the cause would proceed on its course to trial. If unsuccessful, the order of the lower court would stand without prejudice to the right of the state to refile.
Moreover, either a supreme court justice or a district judge may issue a writ of habeas corpus. Nev.Const. art. 6, §§ 4 and 6; NRS 34.380. If issued by a supreme court justice, there can be no review. Yet, the state's right to proceed should not be barred by a correctible mistake. The right to refile is essential in this circumstance.
Finally, we note that the writ of habeas corpus is not confined in its use to criminal *135 matters. For example, it is utilized in child custody cases (McGlone v. McGlone, 86 Nev. ___, 464 P.2d 27 (1970)) and in other areas. The right to appellate review is insured by NRS 34.380(4). Refiling in these instances is not an available procedure.
It is apparent that each statute, NRS 34.590 and NRS 34.380(4), enjoys a significant role in our procedural machinery, depending upon the circumstances, sometimes providing the sole remedy and sometimes a choice of remedies. In the present context, the availability of appellate review did not preclude refiling.
Affirmed.
COLLINS, C.J., and ZENOFF, BATJER and MOWBRAY, JJ., concur.
NOTES
[1]  NRS 34.590 reads: "No person who has been discharged by the order of the judge upon habeas corpus issued pursuant to the provisions of this chapter shall be again imprisoned, restrained or kept in custody for the same cause, except in the following cases:

"1. If he shall have been discharged from custody on a criminal charge and be afterwards committed for the same offense by legal order or process.
"2. If after a discharge for defect of proof, or for any defect of the process, warrant or commitment in a criminal case, the prisoner be again arrested on sufficient proof and committed by legal process for the same offense."
[2]  NRS 34.380(4) reads: "The State of Nevada is an interested party in habeas corpus proceedings, and, in the event the district judge or district court to whom or to which an application for a writ of habeas corpus has been made shall grant such writ, then the district attorney of the county in which the application for the writ was made, or the attorney general in behalf of the state, may appeal to the supreme court from the order of the district judge granting the writ and discharging the applicant; but such appeal shall be taken within 20 days from the day of entry of the order."
