(setq hasMilliSecs (/= (getvar "MILLISECS") nil))
(setvar "LOGFILEMODE" 0)

(defun t_inters ( count fptr / i time1 time2 a b c d k l m n p q r s )
  ;;-----------------------------
  (setq a '(1.0 1.0) b '(9.0 9.0))
  (setq c '(4.0 1.0) d '(4.0 2.0))
  (setq k '(1.0 1.0 0.0) l '(9.0 9.0 0.0))
  (setq m '(4.0 1.0 0.0) n '(4.0 2.0 0.0))
  (setq p '(0.0 0.0 0.0) q '(1.0 0.0 0.0))
  (setq r '(1.0 0.0 2.0) s '(1.0 0.0 4.0))
  ;;-----------------------------
  (setq time1 (getvar "MILLISECS"))
  (if (not time1) (setq time1 (getvar "TDUSRTIMER")))
  (if (not time1) (setq time1 0.0))

  (repeat (* count count)
    (inters a b c d nil)
    (inters k l m n nil)
    (inters p q r s nil)
  )

  (setq time2 (getvar "MILLISECS"))
  (if (not time2) (setq time2 (getvar "TDUSRTIMER")))
  (if (not time2) (setq time2 0.0))
  ;;-----------------------------
  (setq bench$seconds (if hasMilliSecs (* 0.001 (- time2 time1)) (* 86400.0 (- time2 time1))))
  (princ (strcat "* INTERS : " (rtos bench$seconds 2 3) "\n"))
  (if fptr
    (princ (strcat "* INTERS : " (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_inters (* 500 $benchcyclesfactor) nil)
  (setvar "cmdecho" 1)
  (princ)
)
