One time, when I needed to add a very short delay (2 ms), I noticed that the actual delay is almost never the same as the requested one, but instead is usually bigger, more noticeable when the used value is very small. Why is that? You might think it's because of the JScript engine or something related, but if I use -1 (which I assume means no delay), it consistently takes 0 ms.
For example:
var ini;
var t = [-1,2,10,100,1000];
for (var i = 0; i < t.length;i++){
ini = new Date();
DOpus.Delay(t[i]);
DOpus.Output( t[i] +' ms delay expected => '+(new Date()-ini)+'ms received');
}
