Time a function: Difference between revisions

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