500 ms to set a thumbpos??
Alex Tweedly
alex at tweedly.net
Sun Apr 13 17:28:56 EDT 2014
It's good to get the computer to do any hard work for us, but we can
still do some mental arithmetic ....
1026 - 542 gives just under 500ms, and should be accurate.
In fact, you could (if you were in the mood) argue that this method is
more accurate, since it doesn't carry an overhead for resetting strt :-)
-- Alex.
On 13/04/2014 19:58, J. Landman Gay wrote:
> On 4/13/14, 11:42 AM, Dr. Hawkins wrote:
>> While looking for the holdup in some code,
>>
>> put the milliseconds -strt into stp[4]
>> set the thumbpos of sb "dnaScroll" to chrPos
>> put the milliseconds -strt into stp[5]
>> ck "elapsed: " && stp[0] && stp[0] && stp[1] && stp[2] && stp[3] &&
>> stp[4] &&stp[5]
>>
>> The output is
>> elapsed: 0 0 38 38 38 542 1026
>>
>> That's 500 ms, repeatable, for that single line of code setting a
>> thumbpos.
>
> The handler is counting cumulative milliseconds; step 5 is counting
> everything that executed in steps 1 through 5, including the logging
> statement. You'll get a more accurate time if you reinitialize strt to
> zero before setting each thumbpos.
>
More information about the use-livecode
mailing list