Untested, but IMHO it should work...
(defun c:countdown
(/
start
time
insertionPoint
textString
height
textObj
acadObj
doc
modelSpace
)
(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq modelSpace (vla-get-ModelSpace doc))
(setq insertionPoint (vlax-3d-point 0 0 0)
textString "Time Remaining: 00 seconds."
height 0.5
)
(setq textObj (vla-AddText modelSpace textString insertionPoint height)
timeCounter (*
30 ;Seconds
1000.
)
start (getvar 'MILLISECS)
)
(while (< (- (getvar 'MILLISECS) start) timeCounter)
(if (/= (setq textString
(strcat
"Time Remaining: "
(itoa (fix (/ (- timeCounter (- (getvar 'MILLISECS) start)) 1000.)))
" seconds."
))
(vla-get-textstring textObj)
)
(progn
(vla-put-textstring textObj textString)
(vla-update textObj)
)
)
)
(alert "Time limit over...")
(princ)
)