Teach Apple Script to count seconds

do you hava an idea, how I can teach Apple Script to count the seconds from one button-cklick to an other???

thank you… nicki

set intWait to the text returned of (display dialog "Start timer" default answer "5" buttons {"Go"} default button 1)
set startTime to current date
--do some stuff
delay intWait
set endTime to current date
set timeElapsed to endTime - startTime
display dialog (timeElapsed & " seconds elapsed." as string)

Might want to change that to
delay (intWait as integer)

if that is what you want to do…

Or, reading it the other way around (measuring the time between clicks):


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Quite right, so sorry about that. I have a stupid and annoying habit of testing OSX scripts on my 9x station - and I think Jon’s Command performed the coercion to integer which made it work fine as I posted it. I will stop doing that.

Sorry Nicki