When 2 or more persons are charged in the same indictment, whether with the same crime or with different crimes, the judge may at any time during the trial, on the application of any of the accused persons, direct that the trial of any of them shall be had separately from the trial of the other or others of them, and for that purpose may, if a jury has been sworn, discharge such jury from giving a verdict as to any accused person in respect of whom such direction is made.