0

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.

user2504380
  • 535
  • 4
  • 12

1 Answers1

0

The ScheduledExecutorService from JDK offers this functionality

user2504380
  • 535
  • 4
  • 12