LapTime is an AppleScript library to measure execution time of AppleScript in accurary of a few milliseconds. It is useful to evaluate performance of a script and to tune up the script.
You can measure execution time by using current date command which is AppleScript's built-in command. But time resolution of AppleScript's date class is 1 sec, which is too rough for performance measurements.By using NSDate of Cocoa, the time resolution of LapTime is below a few msec.
The simple usage is using start_timer and duration methods. start_timer generate a new LapTime instance. duration method obtain elapsed time from call of start_timer.
To evaluate required times of parts of your script,use lap, lap_ and lap_times methods.lap and lap_ recorods the called time into the LapTime instance generaged by start_timer.lap_times method outputs elapsed times between lap or
lap records only time.lap_ records time with a given label.The label apears in first column of log output of lap_times.The label will help to find the record in the log output.
For precise evaluations of required times of processings in your script,use lap and average.Reapeat execuion of your script many times with repeat statement,and record each execution time with lap.average calculate an average of time diffrences between each lap and start_timer.
Make an instance of LapTime
Return elapsed time form start_timer in msec
Record elapsed time form start_timer in the instance
Record elapsed time form start_timer given a label in the instance
Return time difference in msec between times recorded with lap or lap_
Return time difference between each lap, lap_ and start_timer in msec
Return average of time difference between start_timer and each lap or lap_ in msec