With multi threaded / multi tasking environments, it would be impossible to ensure that the timing is exact. Unless you were coding at the system level, in which case it would wreak havoc with the overall timing of other processes.
When porting the midi library I used the same method that is used in the standard Java version. Which is to check the required timing against elapsed time. That way if one of the calls was slightly out for what ever reason, it would sync itself again on the next call. For audio, a discrepancy in the order of 20 ms would not be noticed as long as it doesn't have a cumulative effect.