timer_info reports incorrect times.




(This is bug 572835; I'm forwarding it to the list.)

timer_info reports times that are 10,000 times faster than those reported
by showtime. An example:

GCL (GNU Common Lisp) Version(2.4.0) Fri Mar 1 22:06:12 CST 2002
Licensed under GNU Library General Public License
Contains Enhancements by W. Schelter
Maxima 5.6 Fr[i Mar 1 22:05:34 CST 2002 (with enhancements by William Schelter).
Licensed under the GNU Public License (see file COPYING)
(C1) doodlebob(n) := block([z,x],
       z : diff(x^x,x,n),
       subst(1,x,z))$

(C2) showtime : all;

Evaluation took 0.00 seconds (0.00 elapsed)
(D2) ALL
(C3) timer(doodlebob)$

Evaluation took 0.00 seconds (0.00 elapsed)
(C4) doodlebob(10);

Evaluation took 3.17 seconds (3.26 elapsed)
(D4) 47160
(C5) get('doodlebob,'runtime);

Evaluation took 0.00 seconds (0.00 elapsed)
(D5) 317
(C6) timer_info();

Evaluation took 0.00 seconds (0.00 elapsed)
      [ FUNCTION TIME//CALL CALLS RUNTIME GCTIME ]
 (D6) [ doodlebob 3.17E-4 SEC 1 3.17E-4 SEC 0.0 ]
      [ TOTAL 3.17E-4 SEC 1 3.17E-4 SEC 0.0 ]
 (C7)


In line (D4), we see that doodlebob(10) took 3.17 seconds while timer_info in
(D6) reports only 3.17e-4 seconds. I think get('function, 'runtime) evaluates to
an integer in hundredths of seconds, but timer_info believes the unit of measure
is microseconds. To fix this, change (defined in mtrace.lisp)

(defun micro-to-sec (runtime)
   (mul runtime 1.0e-6 '$sec))

to

defun micro-to-sec (runtime)
   (mul runtime 1.0e-2 '$sec))

Regards,
Barton