I would like to know how many seconds have passed since the last keystroke (or character that showed up in the screen, whatever is easier).

Is there a timer that is associated to self-insert-command? Alternatively, what is a simple way to achieve my goal?

  • Maybe have a look at how auto save works (especially, there's a variable auto-save-timeout). – JeanPierre Feb 11 at 7:54
  • Could it be that this is an X-Y-problem and you are actually looking for run-with-idle-timer? Otherwise current-idle-time does what you want. – Tobias Feb 11 at 11:05
  • @Tobias: Yes, (nth 1 (current-idle-time)) was what I was looking for. – scaramouche Feb 11 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.