Filtering...

cwtime

books/centaur/vl/util/cwtime
other
(in-package "ACL2")
cwtimemacro
(defmacro cwtime
  (form &key name (mintime 'nil) (minalloc 'nil))
  "Concise time reports with optional names."
  (let ((name (or name
         (and (consp form) (symbolp (car form)) (car form))
         'cwtime)))
    `(time$ ,FORM
      :msg "; ~s0: ~st seconds, ~sa bytes.~%"
      :args (list ',NAME)
      :mintime ,MINTIME
      :minalloc ,MINALLOC)))
xf-cwtimemacro
(defmacro xf-cwtime
  (form &key name (mintime '1/3) (minalloc '67108864))
  "Same as cwtime, but defaults to 1/3 second or 64 MB allocation minimum.
This is nice as a sort of passive performance monitor: if everything is running
quickly you won't be bothered with timing info, but if something is taking
awhile or a lot of memory, you'll get a chance to notice it."
  `(cwtime ,FORM
    :name ,NAME
    :mintime ,MINTIME
    :minalloc ,MINALLOC))