开发者

What is the most reliable android clock to use?

开发者 https://www.devze.com 2023-03-30 01:27 出处:网络
Im implementing my own double tap zoom for my OpenGL ES app and am having issues with System.currentTimeMillis(): It seems like when the main thread gets a little bus开发者_Python百科y, it isnt as acc

Im implementing my own double tap zoom for my OpenGL ES app and am having issues with System.currentTimeMillis(): It seems like when the main thread gets a little bus开发者_Python百科y, it isnt as accurate. 2 taps 200ms apart will show as 600ms apart. What is the most reliable clock to use in Android? I know theres quite a few.


The System.currentTimeMillis() call is quite accurate. The problem is likely that your handler for the tap isn't firing immediately, but because of the load is delayed a few hundred ms.

0

精彩评论

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