Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>JDK offers the Timer class. </p> <p><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html" rel="nofollow noreferrer">http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html</a></p> <p>Reading the docs clearly indicates that beyond the plumbing to make this a generalized framework, it uses nothing more sophisticated than a call to Object.wait(timeout):</p> <p><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" rel="nofollow noreferrer">http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)</a></p> <p>So, you can probably cut the chase an just use Object#wait yourself.</p> <p>Beyond those considerations, the fact remains that JVM can not guarantee time accuracy across platforms. (Read the docs on <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#currentTimeMillis%28%29" rel="nofollow noreferrer">http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#currentTimeMillis()</a>)</p> <p>I think you'll need to experiment with a compromise solution combining Timer and busy polling if you want to want the highest timing precision possible on your platform. Effectively Object#wait(1) -> System#nanoTime -> calculate delta -> [loop if necessary].</p> <p>If you are willing to roll your own, JNI pretty much leaves it wide open for platform specific solutions. I am blissfully un-aware of Window's internals, but obviously if the host OS does provide sufficiently accurate realtime timer services, the barebones structure of setting up a timerRequest(timedelta, callback) native library shouldn't be beyond reach.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload