Android Question How to solve the delay of the timer?

Kedrick164

New Member
Licensed User
Hi good day, i'm making a personalized stopwatch, but this have a delay.

I made a test, i start the stopwatch of the w10 app at the same time of my app in the phone. In sixty seconds of the w10 app, the app of the phone have a delay of two seconds, why does this happen and how can i solve it?, thanks in advance

This is the code

B4X:
Sub Process_Globals

    Dim Timer1 As Timer

End Sub

Sub Globals
  
    Dim lblTime As Label
  
    Dim Time As Double

End Sub

Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("Start")
    Timer1.Initialize("Timer1", 100)
    Timer1.Enabled = False

    Time = 0

End Sub

Sub Timer1_Tick
  
    Time = Time + 0.1
    lblTime.Text = Round2(Time, 2)

End Sub
 
Last edited:

Eme Fibonacci

Well-Known Member
Licensed User
I tested this code on my pc (b4j) and on my android and after 360 seconds the phone was 0.5 second faster. Do tests with others w10 applications.
 
Last edited:
Upvote 0
Top