Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ExecScript vs macro
Message
 
 
To
14/02/2002 16:41:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00620368
Message ID:
00620401
Views:
22
>Hi,
>
>anyone have any performance metrics on 'execscript' vs '&' (macro sub) for code that can use either?
>
>Thanks!

Macro substituion will be faster because execscript has to write the code to the disk, compile it and run.
Here's a test
lnMax = 1000
lcCmd = "lnCount = lnCount + 1"

lnStart = SECONDS()
lnCount = 0
FOR i = 1 TO lnMax
	&lcCmd
ENDFOR	
? "Macro", SECONDS() - lnStart, lnMax, lnCount

lnStart = SECONDS()
lnCount = 0
FOR i = 1 TO lnMax
	EXECSCRIPT(lcCmd)
ENDFOR	
? "EXECSCRIPT", SECONDS() - lnStart, lnMax, lnCount

Result:
Macro - 0.01 sec
Execscript - 16.8 sec
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform