mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-02 20:16:25 +00:00
Add optional FORMAT argument to 'emacs-init-time'
* lisp/time.el (emacs-init-time): Add optional FORMAT argument (bug#47306).
This commit is contained in:
parent
50512e36c7
commit
88fdc4945a
13
lisp/time.el
13
lisp/time.el
@ -614,13 +614,14 @@ point."
|
|||||||
str))))
|
str))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun emacs-init-time ()
|
(defun emacs-init-time (&optional format)
|
||||||
"Return a string giving the duration of the Emacs initialization."
|
"Return a string giving the duration of the Emacs initialization.
|
||||||
|
FORMAT is a string to format the result, using `format'. If nil,
|
||||||
|
the default format \"%f seconds\" is used."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((str
|
(let ((str (format (or format "%f seconds")
|
||||||
(format "%s seconds"
|
(float-time (time-subtract after-init-time
|
||||||
(float-time
|
before-init-time)))))
|
||||||
(time-subtract after-init-time before-init-time)))))
|
|
||||||
(if (called-interactively-p 'interactive)
|
(if (called-interactively-p 'interactive)
|
||||||
(message "%s" str)
|
(message "%s" str)
|
||||||
str)))
|
str)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user