• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Puzzle (Results)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: A puzzle
  • Next by Date: Can't Remove Photos from iPhoto Slideshow using AppleScript / Scripting Bridge
  • Previous by thread: Re: A puzzle
  • Next by thread: Can't Remove Photos from iPhoto Slideshow using AppleScript / Scripting Bridge
  • Index(es):
    • Date
    • Thread