Hello.
I have a service with a timer at 1000 (1 second). The event of the timer stores data in a local database. But in the data I see records no always in a second, for example, every 10 seconds, 30 seconds. This is part of my code:
And the result in the database "Estadisticas" is (the "DateTime.Time(DateTime.Now)" field):
Note the jumps in the data
Thanks a lot
I have a service with a timer at 1000 (1 second). The event of the timer stores data in a local database. But in the data I see records no always in a second, for example, every 10 seconds, 30 seconds. This is part of my code:
B4X:
Sub Service_Create
Timer1.Initialize("Timer1", 1000)
Timer1.Enabled = True
End Sub
B4X:
Sub Timer1_Tick
If vrGrabaDatos=True Then
vrSQL.ExecNonQuery("INSERT INTO Estadisticas VALUES(NULL, '" & vrLatitud & "' , '" & vrLatitudDiff & "' , '" & vrLongitud & " ', '" & vrLongitudDiff & "' , " & vrVelocidadKM & "," & vrDistanciaKM & ", '" & DateTime.Date(DateTime.Now) & "','" & DateTime.Time(DateTime.Now) & "')")
End If
End Sub
And the result in the database "Estadisticas" is (the "DateTime.Time(DateTime.Now)" field):
18:14:01
18:14:02
18:14:03
18:14:04
18:14:06
18:14:27
18:14:28
18:14:29
18:14:50
18:14:56
18:14:57
18:15:17
18:15:18
18:15:19
18:15:28
18:15:29
18:15:30
18:15:31
18:15:32
18:15:36
18:15:37
Note the jumps in the data
Thanks a lot