why is Position.getInfo() faster than info.method

I asked a similar question before, but I am not sure I fully understand the concept due to the results I found. The setup I have is using Toybox.Position module in 3 separate methods:

Method 1: runs Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));

Method 2: the callback method of method1

Method3: gets the position accuracy through info.accuracy

The problem I had was that if I ran method 1 then method 3, I would get an error because method 3 runs faster than the callback method is invoked. I added a null checker to solve this issue and it worked as intended. However, to save energy, I designed my app in a way that method 1 is run periodically and then running   Position.enableLocationEvents(Position.LOCATION_DISABLE, method(:onPosition)) when the accuracy is below a certain threshold. However, this brought back the initial problem; Every time method 1 is run the accuracy is always 'null' because info.accuracy is slower than the callback method onPosition. 

The workaround I did to fix it is that I stopped using info.accuracy and instead, I used Position.getInfo() then got the accuracy from it. As per my understanding from the answer I got before, I expected Position.getInfo() to be always 1 iteration late because it will always run faster than the callback method onPosition(). However, when I examined the results, I found it to be always up to date with the latest location event. Either way, I don't care if it's late because it doesn't affect my specific application but I was curious as to how that works.

The thread can be found here:
forums.garmin.com/.../1702712

  • Understand when you use LOCATION_CONTINUOUS, that turns on GPS until you do a LOCATIOn_DISABLE.  When you turn on GPS, it can take some time to get GPS data - it's not instant, and can vary based on where you are, which type of GPS you are using, and how long since the GPS prediction files have been updated.  30 seconds to a minute is not unusual.  So if you keep turning GPS off and back on, there will be delays.

    Once you have GPS on and have a lock, the callback will be called every second, What is passed to the callback is the same as you get with Position.getInfo(), but what you get with that might be a bit old (less than a second).

    I've never seen accuracy in either case as null.  I've seen it as 0, Which is QUALITY_NOT_AVAILABLE.  You'll get that while GPS is still trying to get going.