I am trying to implement a method which should be called each 10ms with a precision not less than 0.1ms (better 0.05ms). This method is very complex and it is generating sound samples which are placed to float buffer to be played with OnAudioFilterRead function.
I have tried both Coroutines and InvokeRepeating - both are bad, because they can call the method with period from 7ms to 13ms which is not acceptable.
The only idea I have is another Task with while() cycle checking the Time.realtimeSinceStartup permanently. But I feel like this is a bad idea.
Can you help me? Thanks.