JS scripts are executed at 8 frames per second in external view , how to disable/override this?

Hello! I noticed that my Java scripts PIDs perform poorly in external views,
was able to trace it to the reduction of execution frequency if JS code to
only 8 frames per second in any view other than virtual cockpit, is there a
way to override this for a specific gauge?

To follow up on this question with an answer , turns out having a setinterval
running from the constructor bypasses the hard limit of execution frequency in
external view . for example :

  constructor() {
        super();
        this.FrequencyHz=30;
        setInterval(() => {
                this.mainLoop()
        }, 1000/this.FrequencyHz);      
}
 mainLoop() {
//do things at the set frequency
}

Is it not better to actually remove your html/gauges from LOD1, force LOD1 on
external views and just avoid any code from running on external views? R.

Hey @Simbol , yeah that would make sense for disabling the execution
completetly in external view, but in my case I was looking for ways to make
sure that the execution doesn’t slowdown in external view as it runs essential
time sensitive code for the autopilot

Hmm so what happens if LOD2-LOD3 is loaded? the AP code will stop to run? be
careful with this, I had this issue with Sting S4 for the parachute physics
and I had to move things to WASM to prevent the chute from falling out of the
sky when people were setting custom drone cameras very far away… Perhaps you
will need to put AP code inside .XML or other places to avoid that problem…
Best, Raul

The sim will modulate the frequency of requestAnimationFrame based on the
conditions (such as user glass cockpit setting, LOD, etc). As such, I would
recommend using setInterval(() => {/*stuff here*/}, 0) for critical time-
sensitive loops that need per-frame execution, as those timers are not
modulated. However, I would strongly recommend limiting the amount of code
executed in this manner. Certainly I would not attempt to update any rendered
portions of the instruments with this type of loop, or you may see significant
performance degradations. Hope this helps, Matt