Hello, my problem is, ive created a windows program that plays a sound with playsound function from mmsystem.h and then starts a timer that works with getsystemtime and the _systemtime variables.

First, the sound is started with the playsoundfuction, and inmediatly after, the getsystemtime stores the current time in a global variable, later, a loop function calculates the time between frames, but thats not the problem, my problem is that the sound is not played inmediatly, and the storage of the first moment on the execution of the program, is not the same of the start of the sound.

The sound plays with a bigger delay, on slow computers, but the time control variable, always starts inmediatly, so, i need a windows functions that continues the program execution when the sound is just started, and i found no flags for the playsound function with that functionality.

(my native languaje is spanish so, sorry if you dont understand something.....)