Re: Puzzle (Results)
Re: Puzzle (Results)
- Subject: Re: Puzzle (Results)
- From: Marc Glasgow <email@hidden>
- Date: Fri, 21 Nov 2008 15:27:03 -0500
Using:
set startTime to (current date)
set AppleScript's text item delimiters to {"1"}
set counter to 0
repeat with i from 0 to 999999
set counter to (counter + (count (text items of (i as text))) - 1)
end repeat
(current date) - startTime
display dialog (counter as text) & return & the result & " sec"
OS X 10.4.11 MacPro email@hidden, 10 Gb RAM.
Running in the script editor window:
I get 600,000 as the count, in 14 seconds of time.
But running the same code as a stand-alone application, I get:
I get 600,000 as the count, in 57 seconds of time.
PS - might have been nice to reset the delimiters at the end.
Remind me again, what are the default delimiters? LOL
Cheers,
=-= Marc Glasgow
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden