I stumbled upon
import sun.misc.Perf;
because it allows me to get the frequency.
Perf.getPerf().highResFrequency()
Here’s the timer call…
Perf.getPerf().highResCounter();
This seems to work fine when running my app in Windows, Mac and Linux.
In the new NetBeans IDE 6.7 it displays the below warning about using this library.
warning: sun.misc.Perf is Sun proprietary API and may be removed in a future release
So I’m not sure if i should be concerned.
I was trying to use System.nanoTime() but there’s no call to get the frequency. Need the frequency so that the timing is consistent across os’s and platforms.
Is anyone using a different timer system?