An efficient algorithm, called the time-optimal switching (TOS) algorithm, is proposed for the time-optimal switching control of nonlinear systems with a single control input. The problem is formulated in the arc times space, arc times being the durations of the arcs. A feasible switching control, or as a special case bang-bang control, is found using the STC method previously developed by the authors to get from an initial point to a target point with a given number of switchings. Then, by means of constrained optimization techniques, the cost being considered as the summation of the arc times, a minimum-time switching control solution is obtained. Example applications of the TOS algorithm involving second-order and third-order systems are presented. Comparisons are made with a well-known general optimal control software package to demonstrate the efficiency of the algorithm.