Time a function: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: added elapsed() example)
Line 1,727: Line 1,727:
<pre>0.02301709</pre>
<pre>0.02301709</pre>
=={{header|Phix}}==
=={{header|Phix}}==
Measures wall-clock time. On Windows the resolution is about 15ms.
Measures wall-clock time. On Windows the resolution is about 15ms. The elapsed function makes things more human-readable, eg 720 (seconds) => 12 minutes
<lang Phix>atom t0 = time()
<lang Phix>atom t0 = time()
some_procedure()
some_procedure()
printf(1,"%3.2fs.\n",time()-t0)</lang>
printf(1,"%3.2fs\n",time()-t0)
printf(1,"%s\n",{elapsed(time()-t0)})</lang>


=={{header|Phixmonti}}==
=={{header|Phixmonti}}==