B4J Question Timing measurement with B4j and Raspy

MbedAndroid

Active Member
Licensed User
Longtime User
for some reasons i want to measure timing of certain pulses. Those pulses are normally between 100us and 800us.
B4j system timer seems to be 1 ms.
In what way b4j can measure a pulse with enough accuracy, lets say 10% error?

I assume
 

keirS

Well-Known Member
Licensed User
Longtime User
You can use Java Object to get the time in nano seconds.

B4X:
Sub GetNanoTime() As Long
    Dim JONanoTime As JavaObject
    JONanoTime.InitializeStatic("java.lang.System")
    Return JONanoTime.RunMethod("nanoTime",Null)
End Sub
 
Upvote 0
Top