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

(defun t_dictionary ( count fptr / time1 time2 objdict dictionary xname newdict )
  ;;-----------------------------
  (setq objdict (namedobjdict))
  (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))
  (setq xname (entmakex dictionary))
  (setq newdict (dictadd objdict "MY_DICTIONARY" xname))
  (setq datalist '((0 . "XRECORD") (100 . "AcDbXrecord") (1 . "This is my data") (10 1 2 3) (70 . 33)))
  (setq xname (entmakex datalist)) 
  ;;-----------------------------
  (setq time1 (getvar "MILLISECS"))
  (if (not time1) (setq time1 (getvar "TDUSRTIMER")))
  (if (not time1) (setq time1 0.0))

  (repeat (* count count)
    (dictadd newdict "DUMMYKEY" xname)
    (dictrename newdict "DUMMYKEY" "DUMMYKEY_0")
    (dictremove newdict "DUMMYKEY_0")
  )

  (setq time2 (getvar "MILLISECS"))
  (if (not time2) (setq time2 (getvar "TDUSRTIMER")))
  (if (not time2) (setq time2 0.0))
  ;;-----------------------------
  (setq newdict (dictremove objdict "MY_DICTIONARY"))
  (if newdict (entdel newdict))
  ;;-----------------------------
  (setq bench$seconds (if hasMilliSecs (* 0.001 (- time2 time1)) (* 86400.0 (- time2 time1))))
  (princ (strcat "* DICTIONARY : " (rtos bench$seconds 2 3) "\n"))
  (if fptr
    (princ (strcat "* DICTIONARY : " (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_dictionary (* 100 $benchcyclesfactor) nil)
  (setvar "cmdecho" 1)
  (princ)
)
