This paper considers the problem of real-time mode scheduling in linear time-varying switched systems subject to a quadratic cost functional. The execution time of hybrid control algorithms is often prohibitive for real-time applications and typically may only be reduced at the expense of approximation accuracy. We address this trade-off by taking advantage of system linearity to formulate a projection-based approach so that no simulation is required during open-loop optimization. A numerical example shows how the proposed open-loop algorithm outperforms methods employing common numerical integration techniques. Additionally, we follow a receding-horizon scheme to apply real-time closed-loop hybrid control to a customized experimental setup, using the Robot Operating System (ROS). In particular, we demonstrate---both in Monte-Carlo simulation and in experiment---that optimal hybrid control efficiently regulates a cart and suspended mass system in real time.