To really understand this, you need to understand the flows. In a multi-threaded application, the program runs until it waits for something, and then tells the operating system that something else might work. Essentially, you do this with the SDL_Delay . If there were no delays at all, I suspect that your program will run at about 100% speed.
The time you have to put in the delay statement is only relevant if other commands take a considerable amount of time. In general, I would put the delay on the same amount of time that it takes to check the polling command, but no more than, say, 10 ms. What will happen is that the OS will wait at least as long as it will allow other applications to run in the background.
As for what you can do to improve this, well, it looks like you can't do much. However, keep in mind that if you were running another process that required a significant amount of processor power, your program resource would decrease.
source share