Cal. Penal Code § 1382
(a) The court, unless good cause to the contrary is shown, shall order the action to be dismissed in the following cases:
(2) In a felony case, when a defendant is not brought to trial within 60 days of the defendant’s arraignment on an indictment or information, or reinstatement of criminal proceedings pursuant to Chapter 6 (commencing with Section 1367) of Title 10 of Part 2, or, in case the cause is to be tried again following a mistrial, an order granting a new trial from which an appeal is not taken, or an appeal from the superior court, within 60 days after the mistrial has been declared, after entry of the order granting the new trial, or after the filing of the remittitur in the trial court, or after the issuance of a writ or order which, in effect, grants a new trial, within 60 days after notice of the writ or order is filed in the trial court and served upon the prosecuting attorney, or within 90 days after notice of the writ or order is filed in the trial court and served upon the prosecuting attorney in any case where the district attorney chooses to resubmit the case for a preliminary examination after an appeal or the issuance of a writ reversing a judgment of conviction upon a plea of guilty prior to a preliminary hearing. However, an action shall not be dismissed under this paragraph if either of the following circumstances exists:
(B) The defendant requests or consents to the setting of a trial date beyond the 60-day period. In the absence of an express general time waiver from the defendant, or upon the withdrawal of a general time waiver, the court shall set a trial date. Whenever a case is set for trial beyond the 60-day period by request or consent, expressed or implied, of the defendant without a general waiver, the defendant shall be brought to trial on the date set for trial or within 10 days thereafter.
Whenever a case is set for trial after a defendant enters either a general waiver as to the 60-day trial requirement or requests or consents, expressed or implied, to the setting of a trial date beyond the 60-day period pursuant to this paragraph, the court may not grant a motion of the defendant to vacate the date set for trial and to set an earlier trial date unless all parties are properly noticed and the court finds good cause for granting that motion.
(3) Regardless of when the complaint is filed, when a defendant in a misdemeanor or infraction case is not brought to trial within 30 days after he or she is arraigned or enters his or her plea, whichever occurs later, if the defendant is in custody at the time of arraignment or plea, whichever occurs later, or in all other cases, within 45 days after the defendant’s arraignment or entry of the plea, whichever occurs later, or in case the cause is to be tried again following a mistrial, an order granting a new trial from which no appeal is taken, or an appeal from a judgment in a misdemeanor or infraction case, within 30 days after the mistrial has been declared, after entry of the order granting the new trial, or after the remittitur is filed in the trial court, or within 30 days after the date of the reinstatement of criminal proceedings pursuant to Chapter 6 (commencing with Section 1367). However, an action shall not be dismissed under this subdivision if any of the following circumstances exists: