I don't have that much experience with ScriptComunicator or QT
I noticed that the "ScriptTimer" accuracy varies a lot.
When the timer is set to 100ms the timer will fire 10ms to late.
It also varies by +- 5 ~ 20 ms.
The QTtimer class has a function called "timerType"
Is it possible to add that function to ScriptComunicator?
In "scriptTimer.h" there is a list of Q_invocable`s
In there, add the function "setTimerType"
It is something like that but I'm not skilled enough to do so.
I uploaded (File/Test) a prerelease that contains the new timer function setTimerType(String type). Possible values for type are:
- PreciseTimer (Precise timers try to keep millisecond accuracy)
- CoarseTimer (Coarse timers try to keep accuracy within 5% of the desired interval
- VeryCoarseTimer (Very coarse timers only keep full second accuracy)
But I don't think that this will help. A few years ago I wrote a device simulator with ScriptCommunicator. There I had the same effect (on Windows) that you described. I tried several thinks but nothing worked. Then I executed it on a Linux PC and the timing was perfect.
Maybe you should execute your script on a Linux PC too.
Regards,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2021-09-16
Oh.. there is a chat bar below aswell xD
It looks like it working.
it now varies between 1 or 2 ms
thank you this was verry helpful!
P-wassink
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't have that much experience with ScriptComunicator or QT
I noticed that the "ScriptTimer" accuracy varies a lot.
When the timer is set to 100ms the timer will fire 10ms to late.
It also varies by +- 5 ~ 20 ms.
The QTtimer class has a function called "timerType"
Is it possible to add that function to ScriptComunicator?
In "scriptTimer.h" there is a list of Q_invocable`s
In there, add the function "setTimerType"
It is something like that but I'm not skilled enough to do so.
Kind regards.
P-wassink.
Hi,
I uploaded (File/Test) a prerelease that contains the new timer function setTimerType(String type). Possible values for type are:
- PreciseTimer (Precise timers try to keep millisecond accuracy)
- CoarseTimer (Coarse timers try to keep accuracy within 5% of the desired interval
- VeryCoarseTimer (Very coarse timers only keep full second accuracy)
But I don't think that this will help. A few years ago I wrote a device simulator with ScriptCommunicator. There I had the same effect (on Windows) that you described. I tried several thinks but nothing worked. Then I executed it on a Linux PC and the timing was perfect.
Maybe you should execute your script on a Linux PC too.
Regards,
Stefan
Oh.. there is a chat bar below aswell xD
It looks like it working.
it now varies between 1 or 2 ms
thank you this was verry helpful!
P-wassink