B4J Question How do you verify a Timer in a non-ui

Solution
Timer doesn't depend on javafx and you can log and it will show on the terminal.

Just be careful to call startmessageloop before the app shutdown itself.

B4X:
Dim clock as timer 

Public sub app_start(args() as string)
Clock.initialize ("clock",1000) 
Clock.enabled = true 
StartMessageLoop
End sub      

Private sub clock_tick 
Log("tick')
End sub

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Timer doesn't depend on javafx and you can log and it will show on the terminal.

Just be careful to call startmessageloop before the app shutdown itself.

B4X:
Dim clock as timer 

Public sub app_start(args() as string)
Clock.initialize ("clock",1000) 
Clock.enabled = true 
StartMessageLoop
End sub      

Private sub clock_tick 
Log("tick')
End sub
 
Upvote 0
Solution

DonManfred

Expert
Licensed User
Longtime User
what I am after is the numeric count 1,2,3,4,5...
You need to increment a value like you wish. A count is not part of the Timer function.

Create a global integer value, set it to 0 in app_start and increment it in the timer_tick. Check the value whenever you need to know the actual counter...
 
Upvote 0
Top