Emacs personal configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 satır
920B

  1. (defun sanityinc/time-subtract-millis (b a)
  2. (* 1000.0 (float-time (time-subtract b a))))
  3. (defvar sanityinc/require-times nil
  4. "A list of (FEATURE . LOAD-DURATION).
  5. LOAD-DURATION is the time taken in milliseconds to load FEATURE.")
  6. (defadvice require
  7. (around build-require-times (feature &optional filename noerror) activate)
  8. "Note in `sanityinc/require-times' the time taken to require each feature."
  9. (let* ((already-loaded (memq feature features))
  10. (require-start-time (and (not already-loaded) (current-time))))
  11. (prog1
  12. ad-do-it
  13. (when (and (not already-loaded) (memq feature features))
  14. (add-to-list 'sanityinc/require-times
  15. (cons feature
  16. (sanityinc/time-subtract-millis (current-time)
  17. require-start-time))
  18. t)))))
  19. (provide 'init-benchmarking)