More accurate yield

When I execute a yield, it does not seem to last as long as it should. For instance, I say to yield for 0.100 seconds and debugging revealed it was always more than that and always different (0.115, 0.103, etc.). Is there an alternative to yield that will always yield the exact amount of time I set it to?

Yielding to WaitForSeconds actually enters a coroutine that loops for several frames until the specified time has elapsed. Since the duration of each frame varies a lot, you definitely can’t get good precision for small delays. As a rule of thumb, only delays corresponding to about one hundred frames or above are reasonably precise.

If you really need something more precise, try the function InvokeRepeating

rolled a different workaround with two audio sources, thanks for the suggestions.