Re: Timing is everything [Was: Re: Yosemite decimal number conversion error]
Re: Timing is everything [Was: Re: Yosemite decimal number conversion error]
- Subject: Re: Timing is everything [Was: Re: Yosemite decimal number conversion error]
- From: Takaaki Naganoya <email@hidden>
- Date: Thu, 30 Oct 2014 19:43:11 +0900
Thank you, Shane!
This will be a good friend for benchmarks.
--
Takaaki Naganoya
email@hidden
http://piyocast.com/as/
> 2014/10/29 15:33、Shane Stanley <email@hidden> のメール:
>
> 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.
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
>
> _______________________________________________
> 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
_______________________________________________
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