By default FreePIE runs at 64hz which is the system clock speed
This is fine for most cases but sometimes you want more, for example sensor fusion can work better at higher speeds.
Another example is Wiimote.
To get both Motionplus and Nuncuck output at the same time the script engine needs to poll the wiimote exactly at 500hz
You can now choose from 3 different strategies to time FreePIE, SystemTimer, ThreadYield and HighresSystemTimer
Systemtimer
- The default one and the one that leaves no side effects on the system, however if you choose this timing you cant go below 16ms delay (64hz).
- This strategy uses the highres timer in the OS, to get below 16ms it yields the script thread, this means that FrePIE will use all resources from a single CPU core but yield if other processes need CPU time on that core. This can lead to side effects if you play a game which needs a lot of threads
- This strategy changes the the system clock to 1000hz instead of 64hz. This can lead to side effects with programs that rely on that all timer < 16ms = 16ms
Code: Select all
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 2