1

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?

scaramouche
  • 1,772
  • 10
  • 24
  • Maybe have a look at how auto save works (especially, there's a variable `auto-save-timeout`). – JeanPierre Feb 11 '20 at 07:54
  • Could it be that this is an [X-Y-problem](https://meta.stackexchange.com/a/66378/232422) and you are actually looking for [`run-with-idle-timer`](https://www.gnu.org/software/emacs/manual/html_node/elisp/Idle-Timers.html)? Otherwise `current-idle-time` does what you want. – Tobias Feb 11 '20 at 11:05
  • 1
    @Tobias: Yes, `(nth 1 (current-idle-time))` was what I was looking for. – scaramouche Feb 11 '20 at 22:59

0 Answers0