Timing is everything [Was: Re: Yosemite decimal number conversion error]
Timing is everything [Was: Re: Yosemite decimal number conversion error]
- Subject: Timing is everything [Was: Re: Yosemite decimal number conversion error]
- From: Shane Stanley <email@hidden>
- Date: Wed, 29 Oct 2014 17:33:58 +1100
Looking at Takaaki Naganoya's Web site reminded me of a neat hint to do with timing scripts. Typically people do things like:
set a1Dat to current date -- do stuff set b1Dat to current date set c1Dat to b1Dat - a1Dat
for rough timings. That's fine, but sometimes you want better than to the nearest second.
In Yosemite, you can include a 'use framework "Foundation"' statement and then use:
set a1Dat to current application's NSDate's timeIntervalSinceReferenceDate() -- do stuff set b1Dat to current application's NSDate's timeIntervalSinceReferenceDate() set c1Dat to b1Dat - a1Dat
Not only are the commands themselves a bit quicker, but the result includes fractions of a second.
|
_______________________________________________
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