Android Question Can this code be improved?

D

Deleted member 103

Guest
Hi,

This code is meant to be a countdown timer that should trigger a beep every full second.
I've tried a "timer" and a "do while" loop, but the performance is not so good in both.

The beep has a delay of up to 2 hundredths of a second.
Is there a way to reduce this delay?

 

Attachments

  • Beep-Example.zip
    8.4 KB · Views: 496

ilan

Expert
Licensed User
Longtime User

Yes changing the interval will give a whole different result.

The sleep function is also good enough when using 100ms. It is also simpler to handle.
 
Upvote 0
D

Deleted member 103

Guest
The sleep function is also good enough when using 100ms. It is also simpler to handle.
Not really, because it does not happen that a beep at 10sec. comes, but only at 9.9sec.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…