2

I'm trying to get the current time from OS X command line to work with in AppleScript to output the elapsed time.

Currently I'm using this script:

set timea to do shell script "date +%s"
##something is executed
set timeb to do shell script "date +%s"
set runningtime to timeb - timea

But it is too unprecised, so I'm looking for a way how to get the elapsed precisely with milliseconds or somethin.

Thanks. :)

  • 1
    You'll likely want to script your timing in bash (faster to execute) than AppleScript - you could use the gdate command or logger to dump the timing to a file for analysis external to the script if desired... – bmike Apr 02 '16 at 13:43

0 Answers0