WAITFOR uses datetime data type to specify how long to wait. The datetime data type has maximum precision of 3.33ms. So if you specify, for example,
WAITFOR DELAY '00:00:00.001'
then the statement would actually return without waiting for 1ms.
In general you should not depend on WAITFOR to wait for very short amount of time less than 15ms. For example, execute following statements:
declare @start datetime, @end datetime, @i int
set @i = 0
while @i < 100
begin
set @start =GETDATE()
waitfordelay'00:00:00.014'--somehow any values less than 15ms does not work
set @end =GETDATE()
IF @start = @end
RAISERROR('waitfor didn not wait!!',1,1) WITH NOWAIT
set @i = @i + 1
end
In my tests there is about 17% chance that WAITFOR doesn't wait and GetDate() call returns same value as previous call if you set the delay to 14ms. If you increment delay to 15ms you may consistently see that WAITFOR is actually waiting it out. Please not that this is an experimental results and not an official statement.