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
|