Sounds like you want a java.util.Timer

On Tuesday, October 30, 2012 2:41:05 PM UTC-5, marcpolo wrote:
>
> Hi,
>
> I'm developing an application to perform range measurements at 40Hz and 
> display them on a UI.
>
> To achieve this I have created a Runnable class to perform each cycle and 
> I post to the message queue using the postDelay command to schedule the 
> next command for 25ms. My run method is as follows.
>
>         @Override
>         public void run()
>         {
>             m_handler.postDelayed(this, (int)m_samplePeriod_ms);
>             displayRangeData();
>         }
> My timing measurements have shown that around half of the time the run 
> method gets executed at 25ms intervals, whereas the rest are typically 
> around 29-32ms.
>
> Is there a way to increase the priority of the Runnable thread so that I 
> can achieve a consistent 40Hz?
>
> Am I being unrealistic in my expectations? I am running on a Samsung 
> Galaxy S3.
>
> Are there other alternatives? I have tried using a thread but I run into 
> problems when I try to update the UI.
>
> Thanks in advance.
>  
> Marc.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to