@interface GameState : NSObject { CFTimeInterval lastFrameStartTime; ... } ... @end @implementation GameState - (void) simulateAndRenderScene { CFTimeInterval thisFrameStartTime = CFAbsoluteTimeGetCurrent(); float deltaTimeInSeconds = thisFrameStartTime - lastFrameStartTime; *do stuff for simulate and render* lastFrameStartTime = thisFrameStartTime; } @end
xcode iphone 时间戳 毫秒
最新推荐文章于 2023-05-30 15:45:16 发布