I've been doing some testing without much luck, however I have added a 'target fps' variable to showcase how the error is affected in different fps' (although still restricted to a max of 30) but even then setting it higher than 30 has a noticeable difference with going much higher than 30 can even cause it to slow down. Another addition I have added is the perceived fps, which calculates what the fps would be if the perceived frame drop was a result of lag and not an unstable frame rate.
@griffpatch for original project @kfchikinfiter for updated code