I have to create a Timer, firing an event on an elapsed timespan. It easy to write a Runnable with a busy wait loop. It is also easy to include a sleep statement into busy waiting to prevent massive busy waiting. However i need a solution that is precise but still performance friendly. Do you have any suggestions how to implement it? I guess it could be pretty easy using any hack causing InterruptedExceptions but i dont rly know. Is there library offering this functionality in a generic way? I am pretty limited to java. Although, If there are good arguments to use other language impls i would try jna.
Asked
Active
Viewed 27 times
0
-
yes sry, i guess the answer is ScheduledExecutorService anyway. – user2504380 Dec 02 '14 at 11:04