(setvar "LOGFILEMODE" 0)

(defun t_applyand ( count fptr / time1 time2 )
  ;;-----------------------------
  (setq time1 (getvar "TDUSRTIMER"))

  (repeat (* count count)
    (apply 'and (list nil 123 456))
    (apply 'and (list t 123 456 "123" "456" nil))
    (apply 'and (list t 123 456 "123" "456"))
    (apply 'and (list 123 456 "123" "456" t))
    (apply 'and (list 'ABC 'DEF "123" "456" t))
  )

  (setq time2 (getvar "TDUSRTIMER"))
  (if (not time1) (setq time1 0.0))
  (if (not time2) (setq time2 0.0))
  ;;-----------------------------
  (setq bench$seconds (* 86400.0 (- time2 time1)))
  (princ (strcat "* APPLY (and) : " (rtos bench$seconds 2 3) "\n"))
  (if fptr
    (princ (strcat "* APPLY (and) : " (rtos bench$seconds 2 3) "\n") fptr)
  )
  bench$seconds
)

(defun t_applyor ( count fptr / time1 time2 )
  ;;-----------------------------
  (setq time1 (getvar "TDUSRTIMER"))

  (repeat (* count count)
    (apply 'or (list nil 123 456))
    (apply 'or (list t 123 456 "123" "456" nil))
    (apply 'or (list nil nil nil nil nil t))
    (apply 'or (list nil 'ABC 'DEF))
  )

  (setq time2 (getvar "TDUSRTIMER"))
  (if (not time1) (setq time1 0.0))
  (if (not time2) (setq time2 0.0))
  ;;-----------------------------
  (setq bench$seconds (* 86400.0 (- time2 time1)))
  (princ (strcat "* APPLY (or): " (rtos bench$seconds 2 3) "\n"))
  (if fptr
    (princ (strcat "* APPLY (or) : " (rtos bench$seconds 2 3) "\n") fptr)
  )
  bench$seconds
)

;; to increase/decrease the number of bench loops : > 1 increase < 1 decrease
(if (not $benchcyclesfactor) (setq $benchcyclesfactor 1))

;; to run this loaded test manually
(defun C:Run ()
  (setvar "cmdecho" 0)
  (print)
  (t_applyand (* 100 $benchcyclesfactor) nil)
  (t_applyor  (* 100 $benchcyclesfactor) nil)
  (setvar "cmdecho" 1)
  (princ)
)
