Since PowerPro only runs one thread, wait.for will run scripts
sequentially, whereas, events can hang around and run when they are
next in order.
Performance wise, little difference on CPU although wait.for does run
looks like every millisec, and the user can change the test timing
for an event.
Open Taskmgr, select powerpro in Processes and run the following from
a PowerPro note:
;XXXXXXXXXXX
DEBUG
DEBUG **********************
DEBUG Wait.For is now running...
Win.Show("PowerPro debug")
context = timesec
contextlast = 0
Win.Debug(" a.timesec=",context)
Wait.For(10000, ;;+
Assign("contextlast", ;;+
contextlast +1)!="" && contextlast==1000)
Win.Debug("Wait.For DONE: cnt/sec=",;;+
contextlast/(timesec-context),"t#=",contextlast)
DEBUG
Win.Debug(" b.timesec=",timesec)
Local R= ESC(?"\r", ?"\")
context = timesec
contextlast = 0
event.createMS(1,10000,;;+
?#If(Assign("contextlast", contextlast+1) && #++ ;;+
?#contextlast==1000)do#++ R++ ;;+
?#Win.Debug("Event DONE: cnt/sec=",# ++;;+
?#contextlast/(timesec-context)," d.timesec=", timesec, #++;;+
?]"t=#",contextlast)] ++R++ "Event.Destroythis" ++R++ "EndIf")
DEBUG
DEBUG Event is now running...
Win.Debug(" c.timesec=",timesec)
Quit
Someone told me once I'm as clear as mud, but trying to be clear. I
know the above is ugly, but Yahoo limits formating.
IMHO, if it is happening soon, Wait.For is better and easier to
script. However, an event running every 500 millisecs could be tested
500 times in a Wait.For.
A major complication in Events: arguments and variables have to be
global.
Run the above several times and look at the CPU usage.
Hope this helps,
Ted
--- In [email protected], "entropyreduction" wrote:
> --- In [email protected], sgp acs322000 wrote:
>
>> one of your lines intrigued me; I had never realized that you could
> wait.for "while computing"
>
>>> WAIT.For(2000, hThis!=ASSIGN("hAct", WIN.Handle("active")) &&
hAct)
>
>> it made me realize that WAIT.For is sort of a specialized version
of
>> FOR, one that is better suited to deal
>
> wait.for(<expression_to_evaluate>) implies <expression_to_evaluate>
> must be evaluated ever so often. How often? Any thoughts on
whether
> an event waiting on a condition would be more or less efficient than
> wait.for waiting on same?
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/JV_rlB/TM
--------------------------------------------------------------------~->
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/