(a) Whenever a defendant shall be held for trial in circuit court and the defendant alleges that he or she has become insane after being legally charged, the defendant or some person for the defendant must notify the prosecutor and the court at the earliest practicable time.
(b)
(1) Failure to notify the prosecutor within a reasonable time before the trial date shall entitle the prosecutor to a continuance which for limitation purposes shall be deemed an excluded period granted on application of the defendant.
(2) Alternatively, in lieu of suspending all further proceedings in the case, the court may order the immediate examination of the defendant by a qualified psychiatrist or a qualified psychologist.