title: Compute the average time user holds every key down in java swing?
body: <p>I have a <code>JTextField</code> that lets user types in anything they want &amp; when they press "Enter", a <code>JLabel</code> would update and compute the average time on how long they held every key down (so just an average time number, not one average time for each key but all together how long did they held down a key on the keyboard). </p>
  
  <p>Is there a timer or a get time that I can use to get a time whenever a key is pressed down? How would I approach this in Java Swing?</p>