I want to get a key pressing time, in milliseconds.
Example
if User press 'F' key i want to get the value in milliseconds of the pressing time.
public void keyPressed(KeyEvent event) {
int keyCode = event.getKeyCode();
switch (keyCode) {
case KeyEvent.ACTION_DOWN:
// start timer
inizio = System.currentTimeMillis();
break;
case KeyEvent.ACTION_UP:
// end timer
long diffInSec = (System.currentTimeMillis() - inizio);
Toast.makeText(this, "Click durato " + diffInSec, Toast.LENGTH_SHORT).show();
break;}