Created
November 19, 2024 00:49
-
-
Save shapr/312f20fe18f264d0d6275458e012f990 to your computer and use it in GitHub Desktop.
sketch of a busy timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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