Commits

Anonymous committed cf37205

Avoid divide by zero errors when profiling very short duration activities.

Comments (0)

Files changed (2)

+2004-05-03  Jerry James  <james@xemacs.org>
+
+	* profile.el (profile-results): Avoid division by zero.
+
 2004-03-30  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.62 released.
 			     (concat str "\n" (make-string maxfunlen ? ))))
 			 (cdr entry)
 			 (or (gethash (car entry) total-timing) 0)
-			 (* 100 (/ (cdr entry) timing-sum))
+			 (if (zerop timing-sum)
+			     0
+			   (* 100 (/ (cdr entry) timing-sum)))
 			 (let ((count (gethash (car entry) call-count)))
 			   (if count (format "%5d" count) "     "))
 			 (let ((gcval (or (gethash (car entry) gc-usage) 0))