Time a function: Difference between revisions

Line 1,879:
=={{header|Picat}}==
Picat had some built-in timing functions/predicates:
* <code>time/1</code>: reports the time since start of execution. (The related <code>time2/1</code> also reports the backtracks for CP problems.)
* <code>statistics(runtime,[ProgTime,LastTime])</code>: <code>ProgTime</code> is the ms since program started, <code>LastTime</code> is the ms since last call to <code>statistics(runtime,_)</code>. It can be used to create user defined time predicates/functions, as show in <code>time1b/1</code>.
 
<lang Picat>import cp.
495

edits