On 03 Dec 2003, at 16:43, [EMAIL PROTECTED] wrote:
Message: 1 Date: Wed, 3 Dec 2003 00:04:14 -0800 From: Mark Brownell <[EMAIL PROTECTED]> Subject: Re: cross-platform compress & decompress To: How to use Revolution <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII; format=flowed
snip
this is faster: put ((xL bitAnd 4278190080) / 16777216) into zp put (zp bitAnd 255) into a put ((xL bitAnd 16711680) / 65536) into b put ((xL bitAnd 65280) / 256) into c put (xL bitAnd 255) into d
this is slower: put binaryDecode("CCCC",binaryEncode("I",xL),a,b,c,d) into numConverted
but this is still a bit faster: put ((xL bitAnd 4278190080) / 16777216) bitAnd 255 into a #### put ((xL bitAnd 16711680) / 65536) into b put ((xL bitAnd 65280) / 256) into c put (xL bitAnd 255) into d
Mark
on mouseUp ## I added speed testing put num2char("169,170,171,172") into x ## N - decode signed four-byte integers in network order ## put binaryDecode("N",x,halfBlock1) into numConverted ## I - decode unsigned four-byte integers in host order
put binaryDecode("I",x,halfBlock2) into numConverted
put halfBlock2 into xL
----
put the milliseconds into zap1
repeat with ii = 1 to 100000
put ((xL bitAnd 4278190080) / 16777216) into zp
put (zp bitAnd 255) into a
put ((xL bitAnd 16711680) / 65536) into b
put ((xL bitAnd 65280) / 256) into c
put (xL bitAnd 255) into d
end repeat
put the milliseconds into zap2
put zap2 - zap1 into t1 put the milliseconds into zap3
repeat with ii = 1 to 100000
put ((xL bitAnd 4278190080) / 16777216) bitAnd 255 into a ####
put ((xL bitAnd 16711680) / 65536) into b
put ((xL bitAnd 65280) / 256) into c
put (xL bitAnd 255) into d
end repeat
put the milliseconds into zap4
put zap4 - zap3 into t2
put halfblock2 && t1 && t2## result = 2846534572 1406 1120 ## second = 2846534572 1424 1115 /* yep my rig is slower :^) 400 mhz g4 Tibook */
end mouseUp
function num2char sx
repeat for each item i in sx
put numtochar(i) after z
end repeat
return z
end num2charIt is getting under the skin. Greetings, WA
_______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
