0
Not a bug

IR.SetTimeout executes too quickly.

rocfusion 5 years ago in iRidium Script updated by Oksana (expert) 5 years ago 4
Hi,

Create a new project
Add the following script
function hello(){
IR.Log("hello again")
}
IR.AddListener(IR.EVENT_START,0,function()
{
IR.Log("Hello");
IR.SetTimeout(600, hello)
});

Run the project,  I would expect the function hello to execute anytime after 600 milliseconds.  This is not the case.  It always executes before.

Thanks,


Roger
We aim to make the activation time to be ideal but it is not possible due to the following reasons:

1. The operating system is not a real time OS. 
2. Overload of the iRidium core increases th margin of error 
3. The scripts being interpreted increae the margin of error and impair accuracy of the checking systems 

So the accuracy of activation of the SetInterval and SetTimeout functions cannot be 100%.
Hi,

I understand this, there should be a minimum time, since I have seen that sometimes the timeouts execute  between 10 and 50 even though I specified 100 or higher 

This is more apparent when there are more drivers in the project.

Thanks,


Roger
Such work is a feature of the client launch.
We do not plan to change the procedure in V2.x. Perhaps it will be done in V3.x.

At the moment we can recommend increasing the time of SetTimeout.