Wifi location scan blocks loop() for 2+ seconds

I’m testing out the wifi/fused location features in tracker-edge v13 on Device OS 3.0.0 and I noticed that TrackerLocation::buildWpsInfo takes over 2 seconds which blocks all other loop() tasks for at least that long.

Is there any way to avoid long pauses like this while still taking advantage of wifi-based location?

I would flip your code around and put your timing-sensitive code in a separate worker thread so it would not be affected by delays in loop, which could occur for other reasons in addition to Wi-Fi scanning.