Is this known behavior ? I took Erel's example of a Timer,and Looper to blink a led on D4 esp8266. B4R v3.3 Arduino 1.85.
Each cycle thru the loops per millisecond decreases. It starts at 135.xxxx and about every 50 seconds it decreases by one, 134.xxxx ? Left it running for 12 hours. It went down to 9.xxxx loops per millisecond. (not sure as the log doesn't go back that far)
As of now it is climbing backup it is currently at 13.8603 and takes about 50 seconds to increase by 0.1 loops per second, 13.9603. Led is consistently blinking at 5 second intervals.
Did I just roll a counter over or something ? Running Win10 memory and cpu is consistent for B4R. (It is just logging to the pc, where b4r IDE is located. EXE is running on the esp8266.)
This is just an observation on my part. Was working on something else when I noticed this behavior.
Each cycle thru the loops per millisecond decreases. It starts at 135.xxxx and about every 50 seconds it decreases by one, 134.xxxx ? Left it running for 12 hours. It went down to 9.xxxx loops per millisecond. (not sure as the log doesn't go back that far)
As of now it is climbing backup it is currently at 13.8603 and takes about 50 seconds to increase by 0.1 loops per second, 13.9603. Led is consistently blinking at 5 second intervals.
Did I just roll a counter over or something ? Running Win10 memory and cpu is consistent for B4R. (It is just logging to the pc, where b4r IDE is located. EXE is running on the esp8266.)
This is just an observation on my part. Was working on something else when I noticed this behavior.
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private counter As ULong
Public dp As D1Pins
Public blink As Pin
Public Timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
blink.Initialize(dp.D4, blink.MODE_OUTPUT)
Timer1.Initialize("Timer1_Tick", 5000)
Timer1.Enabled = True 'don't forget to enable it
AddLooper("Looper1")
End Sub
Sub Looper1
counter = counter + 1
If counter Mod 100000 = 0 Then
Log("Took me ", Millis, " milliseconds to count to ", counter)
Log(counter / Millis, " loops per milliseconds")
End If
End Sub
Private Sub Timer1_Tick
Dim currentState As Boolean = blink.DigitalRead
'Log("CurrentState: ", currentState)
Dim NewState As Boolean = Not(currentState)
' Log("NewState: ", NewState)
blink.DigitalWrite(NewState)
End Sub