开发者

What's the most accurate way to get timed actions on iPhone?

开发者 https://www.devze.com 2023-01-12 15:21 出处:网络
I want to have something happen about 6 times a second, consistently and accurately.I trie开发者_C百科d setting an NSTimer, but it had very low accuracy and consistency.What would you recommend?Have a

I want to have something happen about 6 times a second, consistently and accurately. I trie开发者_C百科d setting an NSTimer, but it had very low accuracy and consistency. What would you recommend?


Have a look here How Do I write a Timer in Objective-C? it appears that NSTimer is not an high resolution timer


Maybe you want to use ticks instead?

_animationTimer = NSTimer.CreateRepeatingTimer(TimeSpan.FromTicks(Convert.ToInt64(AnimationInterval * 10000000l)), MainLoop);
0

精彩评论

暂无评论...
验证码 换一张
取 消