REDUCE

6.5 Timing Facilities

The command showtime causes REDUCE to print the elapsed time since the last call of this command or, on its first call, since the current REDUCE session began.

Turning on the switch time causes REDUCE to print a message after each command giving the elapsed CPU time since the last command, or since time was last turned off, or the session began.

The time is normally given in milliseconds and gives the time as measured by a system clock. The operations covered by this measure are system dependent.

The Lisp function time() returns CPU time since the session began in milliseconds as an integer. It could be used in algebraic mode to time a computation like this:

        % Make time() available in algebraic mode:
        symbolic operator time;

        start_time := time();
        % perform a computation...
        time_taken := time() - start_time;

        write "Time taken was ", time_taken, " ms.";

Beware that modern computers can perform many computations in less than a millisecond, so the time taken may be reported inaccurately as zero.


Hosted by Download REDUCE Powered by MathJax