; (setq #tt-prj "tt-text-box")
(setq #tt-prj "tt-tab-strip-0")
; (setq #tt-prj "tt-tab-strip-1")
; (progn (dcl-project-load #tt-prj t) (dcl-form-show #tt-prj "form") )
(defun :LST-NUM-AVERAGE (l) (/ (apply '+ l) (float (length l) ) ) )
; - - - - -
(defun :DCL-TIME-TEST ( rep-no / average elapsed-time elapsed-time-lst start )
; -
(defun :DCL-TIME-TEST-SUB ()
(defun C:DCL-TIME-TEST/FORM#ONTIMER (/) (dcl-form-close #tt-prj "form") )
(defun C:DCL-TIME-TEST/FORM#ONINITIALIZE (/) (dcl-Form-StartTimer #tt-prj "form" 10) )
(dcl-project-load #tt-prj t)
(dcl-form-show #tt-prj "form")
)
; -
(repeat rep-no
(setq start (getvar "millisecs") )
(:DCL-TIME-TEST-SUB)
(setq elapsed-time (- (getvar "millisecs") start) )
(setq elapsed-time-lst (append elapsed-time-lst (list elapsed-time ) ) )
)
(setq average (/ (apply '+ elapsed-time-lst) (length elapsed-time-lst) ) )
(princ (strcat "\n average : " (itoa average) ) ) (princ)
average
)
; - - - - -
(defun :DCL-TIME-TEST-100 () (:DCL-TIME-TEST 100 ) )
; - - - - -
(defun C:TT-100 () (:DCL-TIME-TEST-100) )
; - - - - -
(defun C:TT-5000 ( / average average-lst count)
(setq count 0)
(repeat 50
(setq count (+ 1 count) )
(setq average (:DCL-TIME-TEST-100) )
(princ (strcat "\nnumber of repetitions so far : " (itoa (* count 100) ) ) ) (princ)
(setq average-lst (append average-lst (list average ) ) )
)
(princ "\nnumber of repetitions : 5000") (princ)
(princ (strcat "\n average list MIN : " (itoa (apply 'min average-lst) ) ) ) (princ)
(princ (strcat "\n average list MAX : " (itoa (apply 'max average-lst) ) ) ) (princ)
(princ (strcat "\n AVERAGE of AVERAGES : " (rtos (:LST-NUM-AVERAGE average-lst) 2 3) ) ) (princ)
(princ (strcat "\n AVERAGE LIST : " (vl-prin1-to-string average-lst) ) ) (princ)
)