Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip: when sum long strings it is best to group them
Message
From
15/05/2005 12:48:28
 
 
To
15/05/2005 09:44:40
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01014343
Message ID:
01014355
Views:
21
Hi Fabio,

if you know you are handling sizable strings, you could always reach back into the old tricks:
t1=SECONDS()
FOR K=1 TO 10
	 lnX = STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")+ ;
	 	STRTOFILE(m.x, "NUL")
NEXT
? lnX, "StrToFile >> Nul",SECONDS()-t1

t1=SECONDS()
FOR K=1 TO 10
	 lnX =LEN(m.x) + LEN(m.x)+ ;
		LEN(m.x) + LEN(m.x)+ ;
		LEN(m.x) + LEN(m.x)+ ;
		LEN(m.x) + LEN(m.x)
NEXT
? lnX, "Len() summed",SECONDS()-t1
gives on a few of my machines very competitive and suprisingly similar resutls if added into your test program.

regards

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform