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

(defun t_acadstrlsort ( count fptr / time1 time2 strlst )

  (setq strlst
    (list
      "0000000000000"
      "1111111111111"
      "2222222222222"
      "3333333333333"
      "4444444444444"
      "5555555555555"
      "6666666666666"
      "7777777777777"
      "8888888888888"
      "9999999999999"
                    
      "aaaaaaaaaaaaa"
      "bbbbbbbbbbbbb"
      "ccccccccccccc"
      "ddddddddddddd"
      "eeeeeeeeeeeee"
      "fffffffffffff"
      "ggggggggggggg"
      "hhhhhhhhhhhhh"
      "iiiiiiiiiiiii"
      "jjjjjjjjjjjjj"
      "kkkkkkkkkkkkk"
      "lllllllllllll"
      "mmmmmmmmmmmmm"
      "nnnnnnnnnnnnn"
      "ooooooooooooo"
      "ppppppppppppp"
      "qqqqqqqqqqqqq"
      "rrrrrrrrrrrrr"
      "sssssssssssss"
      "ttttttttttttt"
      "uuuuuuuuuuuuu"
      "vvvvvvvvvvvvv"
      "wwwwwwwwwwwww"
      "xxxxxxxxxxxxx"
      "yyyyyyyyyyyyy"
      "zzzzzzzzzzzzz"
                    
      "AAAAAAAAAAAAA"
      "BBBBBBBBBBBBB"
      "CCCCCCCCCCCCC"
      "DDDDDDDDDDDDD"
      "EEEEEEEEEEEEE"
      "FFFFFFFFFFFFF"
      "GGGGGGGGGGGGG"
      "HHHHHHHHHHHHH"
      "IIIIIIIIIIIII"
      "JJJJJJJJJJJJJ"
      "KKKKKKKKKKKKK"
      "LLLLLLLLLLLLL"
      "MMMMMMMMMMMMM"
      "NNNNNNNNNNNNN"
      "OOOOOOOOOOOOO"
      "PPPPPPPPPPPPP"
      "QQQQQQQQQQQQQ"
      "RRRRRRRRRRRRR"
      "SSSSSSSSSSSSS"
      "TTTTTTTTTTTTT"
      "UUUUUUUUUUUUU"
      "VVVVVVVVVVVVV"
      "WWWWWWWWWWWWW"
      "XXXXXXXXXXXXX"
      "YYYYYYYYYYYYY"
      "ZZZZZZZZZZZZZ"

    )
  )
  
  ;;-----------------------------
  (setq time1 (getvar "MILLISECS"))
  (if (not time1) (setq time1 (getvar "TDUSRTIMER")))
  (if (not time1) (setq time1 0.0))

  (repeat (* count count)
       (acad_strlsort strlst)
  )

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