Hard problems in real time are not a proper Java application. Too many variables, such as garbage collection and threads, that are not guaranteed for a given interval to make this possible. If close enough, then it will work. The performance of your software depending on the time will also depend on the OS and hardware used, as well as on what other programs also work in this field.
There is Real Time Java , which has a special API for the problems that I mentioned above. You do not indicate that you are using this. It is also a different animal in many ways than plain Java.
source share