500 ms to set a thumbpos??

Alex Tweedly alex at tweedly.net
Sun Apr 13 18:16:26 EDT 2014


On 13/04/2014 23:02, J. Landman Gay wrote:
> Except we don't know how intensive the ck handler is.
>
Do we need to ?
stp[4] and stp[5] are set before 'ck' is called. So (assuming the 
numbers that are eventually output are the ones being passed) we don't 
care what else is being done in ck, other than outputting these values.
> On 4/13/14, 4:28 PM, Alex Tweedly wrote:
>> 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.
>>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>





More information about the use-livecode mailing list