From: Francis W. <f.j...@li...> - 2024-01-04 20:11:57
|
You can get the time taken for a computation in millisecond in the REDUCE variable time_taken like this: % Make the Lisp time function available in algebraic mode. % It returns CPU time since the program started in milliseconds as an integer. symbolic operator time; start_time := time(); % Evaluate an integral (for example)... time_taken := time() - start_time; Francis ________________________________ From: Nasser M. Abbasi <nm...@12...> Sent: 04 January 2024 1:09 AM To: red...@li... <red...@li...>; Nasser M. Abbasi <nm...@12...> Subject: [Reduce-algebra-developers] How to use on time; in reduce to record time used for a command? I am new learning reduce. I need to record CPU time used by the integrate command. I see in the manual, at page 70, there is on time; and off time; "causes the system to print a message after each command giving the elapsed CPU time since the last command" Could someone please show me how the Reduce code will look like if one wants to _save_ the time time used in a variable? For example on time; int(sin(x),x); off time; Since it prints time used on the screen, this is not useful for me. I need to find the time used and save it to variable, so that eventually write the record to a file. I just do not know how to capture the output and convert it to a numerical value and save it to a variable. Thanks --Nasser _______________________________________________ Reduce-algebra-developers mailing list Red...@li... https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers |