Real-time simulation models play an important role in the development of engine control systems. The mean value model (MVM) meets real-time requirements but has limited accuracy. By contrast, a crank-angle resolved model, such as the filling -and-empty model, can be used to simulate engine performance with high accuracy but cannot meet real-time requirements. Time complexity analysis is used to develop a real-time crank-angle resolved model with high accuracy in this study. A method used in computer science, program static analysis, is used to theoretically determine the computational time for a multicylinder engine filling-and-empty (crank-angle resolved) model. Then, a prediction formula for the engine cycle simulation time is obtained and verified by a program run test. The influence of the time step, program structure, algorithm and hardware on the cycle simulation time are analyzed systematically. The multicylinder phase shift method and a fast calculation method for the turbocharger characteristics are used to improve the crank-angle resolved filling-and-empty model to meet real-time requirements. The improved model meets the real-time requirement, and the real-time factor is improved by 3.04 times. A performance simulation for a high-power medium-speed diesel engine shows that the improved model has a max error of 5.76% and a real-time factor of 3.93, which meets the requirement for a hardware-in-the-loop (HIL) simulation during control system development.