B4J Question Timer 1uS

stevel05

Expert
Licensed User
I don't know if it will be any use to you, but attached is a tiny one function library that just gets the System Nanotime.

From Oracle Docs:
static long nanoTime()
Returns the current value of the most precise available system timer, in nanoseconds.

I created it for use in an Android project, but never got round to using it. I would guess that system processing time would make it all but redundant, but it's here if you want to try it. It works on B4j.

B4X:
Dim N As Nanotime
Log(N.NanoTime)
 

Attachments

  • NanoTime.zip
    1.4 KB · Views: 103
Upvote 0

YIM bunchhat

Active Member
Licensed User
@stevel05 , Thank you. I will test it. I want to use timer 1us because b4j could run on my Raspberry Pi. I want to use it control my Servo Motor which work with pulse between 1000us to 2000us.
 
Upvote 0

YIM bunchhat

Active Member
Licensed User
I don't know if it will be any use to you, but attached is a tiny one function library that just gets the System Nanotime.

From Oracle Docs:


I created it for use in an Android project, but never got round to using it. I would guess that system processing time would make it all but redundant, but it's here if you want to try it. It works on B4j.

B4X:
Dim N As Nanotime
Log(N.NanoTime)
Hello after test I got this result = 12048400807360, what does it means?
 
Upvote 0
Top