• 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: A faster offset...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A faster offset...


  • Subject: Re: A faster offset...
  • From: Emmanuel <email@hidden>
  • Date: Thu, 6 Sep 2001 16:32:45 +0200

At 9:29 +0200 6/09/01, David Lloyd wrote:

>--snippet 1-----
>
>repeat 500 times
> copy (offset of "x" in "asdxasd") to o
>end repeat
>
>--snippet 2-----
>
>repeat 500 times
> copy offsetInString("x", "asdxasd") to o
>end repeat
>
>on offsetInString(theItem, theString)
> if theItem  "" then
> set AppleScript's text item delimiters to theItem
> copy (text items of theString) to theItems
> set AppleScript's text item delimiters to ""
> if (count of theItems) = 1 then
> return 0
> else
> return (length of item 1 of theItems) + 1
> end if
> else
> return 0
> end if
>end offsetInString

-- {6.35, 4.38} (seconds for 5000 iterations)

Only a small 2 factor here?

Emmanuel


References: 
 >A faster offset... (From: David Lloyd <email@hidden>)

  • Prev by Date: Re: OneClick and QuicKeys {WAS: OSA Menu Lite]
  • Next by Date: Re: can i 'store script' as stay open applet?
  • Previous by thread: A faster offset...
  • Next by thread: Re: A faster offset...
  • Index(es):
    • Date
    • Thread