Best practice for timing (Audio thread)

In this thread:

I try to do timing based on sample counting using for a mdidi plugin. By default this has no audio channels and so the buffer size seems to be 0.

This is a good example on why I am asking for best practice…