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

(defun t_ssget_crossing ( count fptr / time1 time2 ss p1 p2 )
  ;;-----------------------------
  (entmakex '((0 . "LINE")(10 0 0 0)(11 1 1 0)))
  (entmakex '((0 . "LINE")(10 1 1 0)(11 0 2 0)))
  (entmakex '((0 . "LINE")(10 0 2 0)(11 3 3 0)))
  (entmakex '((0 . "LINE")(10 3 3 0)(11 0 4 0)))
  (entmakex '((0 . "LINE")(10 0 4 0)(11 5 5 0)))
  (command "_zoom" "_window" '(-5 -5) '(10 10))
  (setq p1 '(-1 -1) p2 '(6 6))
  ;;-----------------------------
  (setq time1 (getvar "MILLISECS"))
  (if (not time1) (setq time1 (getvar "TDUSRTIMER")))
  (if (not time1) (setq time1 0.0))

  (repeat count
    (ssget "_C" p1 p2)
  )

  (setq time2 (getvar "MILLISECS"))
  (if (not time2) (setq time2 (getvar "TDUSRTIMER")))
  (if (not time2) (setq time2 0.0))
  ;;-----------------------------
  (setq ss (ssget "X"))
  (command "_erase" ss "") (setq ss nil)
  ;;-----------------------------
  (setq bench$seconds (if hasMilliSecs (* 0.001 (- time2 time1)) (* 86400.0 (- time2 time1))))
  (princ (strcat "* SSGET Crossing : " (rtos bench$seconds 2 3) "\n"))
  (if fptr
    (princ (strcat "* SSGET Crossing : " (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_ssget_crossing (* 2000 $benchcyclesfactor) nil)
  (setvar "cmdecho" 1)
  (princ)
)
