Re: Hide tooltip instantly?
Posted: Mon Apr 08, 2024 8:25 am
You are right Richard: working with a property is less time consuming than I thought. I redid the following test and the difference in execution time between the different methods is not significant for a few hundred iterations.
Now, regarding my tooltip problem, I admit that if the solution proposed by Jacque works, I will keep it without looking further, but it may take a little time because my bug did not appear very often.
Test script for un button:
Now, regarding my tooltip problem, I admit that if the solution proposed by Jacque works, I will keep it without looking further, but it may take a little time because my bug did not appear very often.
Test script for un button:
Code: Select all
local gVar
on mouseUp
local iterCount
ask "Number of iterations:" with 10000
if it is an integer then
put it into iterCount
set the Test of this stack to ""
answer "Iterations:" && iterCount & cr & cr & "Variable:" && testVar(iterCount) && "ms" & cr & \
"Function:" && testFunction(iterCount) && "ms" & cr & "Property:" && testProperty(iterCount) && "ms"
end if
end mouseUp
function testVar pIterCount // local variable test
local tStartTimer, tVar, tempVar
put the milliseconds into tStartTimer
repeat with i = 1 to pIterCount
put i + 1 into tVar
put tVar into tempVar
end repeat
return the milliseconds - tStartTimer
end testVar
function testFunction pIterCount // getter/setter function test
local tStartTimer, tempVar
put the milliseconds into tStartTimer
repeat with i = 1 to pIterCount
setValue i + 1
put getValue() into tempVar
end repeat
return the milliseconds - tStartTimer
end testFunction
function getValue
return gVar
end getValue
on setValue varValue
put varValue into gVar
end setValue
function testProperty pIterCount // stack property test
local tStartTimer, tempVar
put the milliseconds into tStartTimer
repeat with i = 1 to pIterCount
set the Test of this stack to i + 1
put the Test of this stack into tempVar
end repeat
return the milliseconds - tStartTimer
end testProperty