Skip to content

Instantly share code, notes, and snippets.

@shapr
Created November 19, 2024 00:49
Show Gist options
  • Save shapr/312f20fe18f264d0d6275458e012f990 to your computer and use it in GitHub Desktop.
Save shapr/312f20fe18f264d0d6275458e012f990 to your computer and use it in GitHub Desktop.
sketch of a busy timer
(defconst shapr-idle-duration 60)
(defvar shapr-busy-timer nil)
(defun shapr-busy ()
(when shapr-busy-timer
(cancel-timer shapr-busy-timer))
;; Do some http stuff here
(setq shapr-busy-timer
(run-with-idle-timer
(time-add (current-idle-time) shapr-idle-duration)
nil
'shapr-busy)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment