"Do-not-disturb" / real-time mode?

Hi all,
I’m adding Blynk on my project, that involves controlling a motor using PID control techniques. The code runs on an ESP8266.

Most of the time the system is idle and ready to accept commands from Blynk. But when I get a “move” command, I want the processor to be completely dedicated to one task, i.e. not running any Blynk/Wi-Fi task, for 4-5 seconds. This because if the PID loop is not run at regular intervals (30ms), the motor may spin more than necessary and potentially cause some damage.
Right now the code runs fine, but I see fairly long pauses (even 4 seconds) every once in a while. This is probably due to the Wi-Fi stack or Blynk running some background tasks.

Is it possible to tell Blynk and the whole Wi-Fi stack to go into “real-time” mode, i.e. temporarily stop running any background tasks, and resume them when it’s OK to do so?
How can I be sure that no other background tasks are running in the system? And stop them too?

Kind regards,

You can disconnect from the Blynk server and disable WiFi but I’m not entirely sure that the ESP wouldn’t be doing anything in the background.

Thank you, I’ll ask in the ESP8266 forum.

About disconnecting Blynk: it is enough to call Blynk.disconnect() and stop calling Blink.run()?

yes once you have called Blynk.disconnect() this “2 line maximum recommended Blynk loop()” will be fine:

void loop(){