• 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
Speed Testing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Speed Testing


  • Subject: Speed Testing
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 13 Apr 2012 16:32:32 -0500

Hey Folks,

If you're doing speed testing I highly recommend the LapTime OSAX or Smile and its 'chrono' function.

I've got the handlers in a library to avoid clutter.

------------------------------------------------------------------------------------------------
--» HANDLERS
------------------------------------------------------------------------------------------------
--» START_TIMER()
------------------------------------------------------------------------------------------------
--   PURPOSE: Uses the LapTime.osax to produces a timer set.
--  MODIFIED: 2012-04-08 : 09:59
------------------------------------------------------------------------------------------------
on START_TIMER()
return start timer
end START_TIMER
------------------------------------------------------------------------------------------------
--» STOP_TIMER()
------------------------------------------------------------------------------------------------
--   PURPOSE: Companion to START_TIMER() — Uses 'format' command from Satimage.osax.
--  MODIFIED: 2012-04-08 : 10:01
------------------------------------------------------------------------------------------------
on STOP_TIMER(tmrNumber)
return format ((stop timer tmrNumber) / 1000) into "##.####"
end STOP_TIMER
------------------------------------------------------------------------------------------------

set tmr1 to START_TIMER() of me

# Your Script

set tmr1Stop to STOP_TIMER(tmr1) of me

# It can do a good bit more than this.

------------------------------------------------------------------------------------------------

The LapTime OSAX is a very serviceable replacement for the old MilliSec OSAX, however we went for a long period of time when such a thing wasn't available for Mac OS X.  During that time I used Smile for all my speed-testing needs, and I still use it for a variety of things despite the fact that I develop in Script Debugger.

# Smile
chrono
repeat 10000 times
set x to "some string"
end repeat
chrono

--> 0.006664315995 seconds

--
Best Regards,
Chris

 _______________________________________________
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: Script performance and Safari
  • Next by Date: Re: Script performance and Safari
  • Previous by thread: Re: AppleScript-Users Digest - increase the performance of this script
  • Next by thread: Bugs
  • Index(es):
    • Date
    • Thread