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

(defun t_ssadd ( count fptr / time1 time2 ss e1 e2 e3 e4 e5 )
  ;;-----------------------------
  (command "_line" (list 0 0) (list 1 1) "") (setq e1 (entlast))
  (command "_line" (list 1 1) (list 2 3) "") (setq e2 (entlast))
  (command "_line" (list 2 3) (list 3 3) "") (setq e3 (entlast))
  (command "_line" (list 3 3) (list 4 4) "") (setq e4 (entlast))
  (command "_line" (list 4 4) (list 5 5) "") (setq e5 (entlast))
  (setq ss (ssadd))
  ;;-----------------------------
  (setq time1 (getvar "MILLISECS"))
  (if (not time1) (setq time1 (getvar "TDUSRTIMER")))
  (if (not time1) (setq time1 0.0))

  (repeat (* count count)
    (ssadd e1 ss)
    (ssadd e2 ss)
    (ssadd e3 ss)
    (ssadd e4 ss)
    (ssadd e5 ss)
  )

  (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 "* SSADD : " (rtos bench$seconds 2 3) "\n"))
  (if fptr
    (princ (strcat "* SSADD : " (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_ssadd (* 100 $benchcyclesfactor) nil)
  (setvar "cmdecho" 1)
  (princ)
)
