Checking the Milliseconds

Tom Glod tom at makeshyft.com
Wed Apr 7 18:14:11 EDT 2021


Excellent ... Yes the 1st one was usually the one that was the lowest for
me, for the reason you described.
But you also cleared up the mysterious big jumps,I too now get a consistent
result.
Thanks for chimming in


On Wed, Apr 7, 2021 at 3:59 PM Niggemann, Bernd via use-livecode <
use-livecode at lists.runrev.com> wrote:

> I tried this and got pretty constant results except for maybe  the first
> ten iterations. I figured if you just jump in with the milliseconds you
> would not be at the "beginning" of the milliseconds and added a repeat loop
> to mitigate that effect. Furthermore I appended the result to a variable.
>
> -------------------------------------------
> local last_known_millisecond
> local queries = 0
> local report
> local longSecs, tMs
>
> on mouseUp
>    lock screen
>    put empty into report
>
>    --let it start at a flip of the ms
>    repeat
>       put the milliseconds into tMs
>       if char -1 of tMs is 0 then
>          exit repeat
>       end if
>    end repeat
>
>    repeat 1000 times
>       put 0 into queries
>       put the long seconds into longSecs
>       put the milliseconds into last_known_millisecond
>       repeat forever
>          add 1 to queries
>          if the milliseconds = last_known_millisecond  then
>             next repeat
>          else
>             exit repeat
>          end if
>       end repeat
>       put queries && (the long seconds - longSecs) * 1000  & cr after
> report
>    end repeat
>
>    unlock screen
>    put report
> end mouseUp
> --------------------------
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Tom Glod
Founder & Developer
MakeShyft R.D.A (www.makeshyft.com)
Mobile:647.562.9411



More information about the use-livecode mailing list