Menu

featurerequests - more acurate timer.

Anonymous
2021-09-15
2021-09-16
  • Anonymous

    Anonymous - 2021-09-15

    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.

     
  • Stefan Zieker

    Stefan Zieker - 2021-09-15

    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

     
  • 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

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.