I have a program that uses the sleep function in VBA from the kernel library.
It has a tendency to work inconsistently. All of the sudden it will start to run really slowly. I will have to turn the time down from 1 to .1 in order to get it to work at the speed it used to.
There are not any other programs running that would "slow" it down. I am running the application on a core 2 processor.
Is there any other functions I can use to delay something by a millesecond? Perhaps something that may act more consistent.
Public timerCounter As Integer
Const TIMERLIMIT = 1
Private Declare Sub sapiSleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Sub sSleep(lngMilliSec As Long)
If lngMilliSec > 0 Then