Help with key timings!

Hi everyone xD just thought id say that first… im new… il probably be hanging around here a fair bit xP

Trying to get the time between pressing the space bar and letting it go… so far ive got something like this…

keyListener.SPACE.onKeyDown = function() { 
   startCount = newTime.getTime()  
  keyListener.onKeyUp = function() {
   stealTime = newTime.getMilliseconds() –= startCount
  } 

doesnt quite work (bad syntax i know) think im on the rite method just need someone tidy it or let me know how i can fix… be much appreciated xD

Oh also… i cant type in this box in the firefox browser? any ideas why? oO

Thanks again!