有个代码讲的很好
这个文章
float timer = 0; while(true) { while(timer > fixedStep) { FixedUpdate(); timer -= fixedStep; } Update(); timer += deltaTime;