I am a bit puzzled. According to this thread the sleep function should "...block the current thread for at least...", implying a minimum sleep time.
However, a short test program implies that it sleeps less than 200ms. It tells me a call is made 6 times within 1199ms, which would mean a consistent shorter sleep time than 200ms.
The sample code that I used:
static int numCalls = 0;
static Stopwatch swSamples = new Stopwatch();
static void Main(string[] args) {
swSamples.Start();
for (int i = 0; i < 6; i++) {
// wait
Thread.Sleep(200);
// make call
numCalls++;
}
// display
Console.WriteLine("numCalls: " + numCalls + " - " + swSamples.ElapsedMilliseconds);
Console.ReadLine();
}
Please note that this question is not about getting exact 5 calls per second, it is about the time a thread actually sleeps not being "at least" ...ms