用command命令画1000个圆,2004与2010所用时仅相差0.3秒。
1234平均CAD 20042.734 2.999 2.451 2.440 2.656 CAD 20102.954 2.921 2.939 2.936 2.938- (defun c:test()
- (setq cm (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (setq t0 (getvar "cdate")
- r 1
- )
- (repeat 1000
- (command "_circle" '(0 0) r)
- (setq r (+ r 1))
- )
- (setq t1 (getvar "cdate"))
- (princ (strcat "\n共耗时" (rtos (* 1000000 (- t1 t0)) 2 3) "秒"))
- (setvar "cmdecho" cm)
- (princ)
- )
|