I would like to sleep for packetSize/Bandwidth amount of duration for a network application in VB.
This value varies from "10^-3 - 10^-6" seconds.
When I use the Sleep() func, I think it is not sleeping for the duration if it is less than unity (< 1 sec ~~ 0 sec??).
Edited:
How to achieve this?
The resolution of Sleep is to the millisecond - that's 10^-3. (See http://msdn.microsoft.com/en-us/library/d00bd51t.aspx and http://msdn.microsoft.com/en-us/library/274eh01d.aspx ). One second is 1000 milliseconds; that's Sleep(1000).
You cannot use Sleep() for values less than 10^-3 seconds. I have used Sleep() with values of 62, 125, and 250 milliseconds successfully.
You can experiment with System.Diagnostics.Stopwatch; maybe a Wait or Pause function can be built from that. (See http://msdn.microsoft.com/en-us/library/ebf7z0sw.aspx )