SpenceMan
asked on
Microsecond accuracy in Java
I am building a device that uses a Parallax PING sensor. I would like to be able to use Java to control the PING because I have a Java 3D environment. I can communicate with the PING but I have not found a way to get the resolution I need (microseconds). nanoTime() has the precision but not the accuracy, at least the way I am implementing it. Any ideas on what I can do?
You might try making a native system call if the OS supports it
Yeah, I was thinking about it
Even if it does support it, I suspect it will take at least a millisecond to get processed via JNI (or whatever is used to call it) so it won't be better than just using the milliseconds we have... Or even if it is not a full millisecond, it will still be off.... that's why I do not think that the accuracy can be achieved...
Even if it does support it, I suspect it will take at least a millisecond to get processed via JNI (or whatever is used to call it) so it won't be better than just using the milliseconds we have... Or even if it is not a full millisecond, it will still be off.... that's why I do not think that the accuracy can be achieved...
ASKER
I have heard people talk about the library javax.realtime and people using it, but it is no where to be found. Sort of like Big Foot. Any info on that?
For right now I ended up getting a micro controller that I can program in C to communicate with the sensors separately from the java program. It get's the job done.
For right now I ended up getting a micro controller that I can program in C to communicate with the sensors separately from the java program. It get's the job done.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
PS: You know that it is not supported on most OSs, right?
And there is no other method that can help you.
Sorry :(