This code here uses Sleep if necessary and makes sure the code is executed the required amount in seconds. You can actually make the code execute more often. It isn't perfectly accurate (thanks to Sleep), but a human can't possibly notice the millisecond differences. I can't really see anyone using this for thousands of iterations/second.
Attached a sample project which has one iteration (0) doing nothing for 1000 times/second, and another (1) for updating Form1.Caption every one seconds.
So basically this is just a very advanced version of the sample code by CVMichael (using QueryPerformanceCounter instead and controls the timings).