<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>timing -- time a computation</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_wait.html">next</a> | <a href="_time.html">previous</a> | <a href="_wait.html">forward</a> | <a href="_time.html">backward</a> | <a href="_system_spfacilities.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="___The_sp__Macaulay2_splanguage.html" title="">The Macaulay2 language</a> > <a href="_system_spfacilities.html" title="">system facilities</a> > <a href="_timing.html" title="time a computation">timing</a></div> <hr/> <div><h1>timing -- time a computation</h1> <div class="single"><h2>Description</h2> <div><tt>timing e</tt> evaluates <tt>e</tt> and returns a list of type <a href="___Time.html" title="the class of all timing results">Time</a> of the form <tt>{t,v}</tt>, where <tt>t</tt> is the number of seconds of cpu timing used, and <tt>v</tt> is the value of the the expression.<p/> The default method for printing such timing results is to display the timing separately in a comment below the computed value.<table class="examples"><tr><td><pre>i1 : timing 3^30 o1 = 205891132094649 -- 4.77049e-17 seconds o1 : Time</pre> </td></tr> <tr><td><pre>i2 : peek oo o2 = Time{4.77049e-17, 205891132094649}</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="___Time.html" title="the class of all timing results">Time</a> -- the class of all timing results</span></li> <li><span><a href="_time.html" title="time a computation">time</a> -- time a computation</span></li> <li><span><a href="_cpu__Time.html" title="seconds of cpu time used since Macaulay2 began">cpuTime</a> -- seconds of cpu time used since Macaulay2 began</span></li> </ul> </div> <div class="waystouse"><h2>For the programmer</h2> <p>The object <a href="_timing.html" title="time a computation">timing</a> is <span>a <a href="___Keyword.html">keyword</a></span>.</p> </div> </div> </body> </html>