aboutsummaryrefslogtreecommitdiff
path: root/docs/spec/system.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/spec/system.html')
-rw-r--r--docs/spec/system.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/spec/system.html b/docs/spec/system.html
index 255265f4..2c6c3321 100644
--- a/docs/spec/system.html
+++ b/docs/spec/system.html
@@ -241,3 +241,37 @@
</tbody>
</table>
<h2 id="timing">Timing</h2>
+<table>
+<thead>
+<tr>
+<th>Name</th>
+<th>Summary</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code><span class='Function'>•UnixTime</span></code></td>
+<td>Time between Unix epoch and function call</td>
+</tr>
+<tr>
+<td><code><span class='Function'>•MonoTime</span></code></td>
+<td>Monotonically-increasing time counter for relative measurement</td>
+</tr>
+<tr>
+<td><code><span class='Function'>•Delay</span></code></td>
+<td>Wait at least <code><span class='Value'>𝕩</span></code> seconds, and return the actual wait time</td>
+</tr>
+<tr>
+<td><code><span class='Modifier'>•_timed</span></code></td>
+<td>Call <code><span class='Function'>𝔽</span></code> on <code><span class='Value'>𝕩</span></code> <code><span class='Value'>𝕨</span><span class='Function'>⊣</span><span class='Number'>1</span></code> times, and return the average duration</td>
+</tr>
+<tr>
+<td><code><span class='Modifier2'>•_maxTime_</span></code></td>
+<td>Call <code><span class='Function'>𝔽</span></code> on the arguments, but fail if it takes over <code><span class='Value'>𝕨</span><span class='Function'>𝔾</span><span class='Value'>𝕩</span></code> seconds</td>
+</tr>
+</tbody>
+</table>
+<p>All times are measured in seconds.</p>
+<p>The <a href="https://en.wikipedia.org/wiki/Unix_time">Unix epoch</a> is 1970-01-01 00:00:00 UTC. <code><span class='Function'>•UnixTime</span></code> is intended for absolute time measurement and should be implemented with the method that gives the most accurate result at any given time. <code><span class='Function'>•MonoTime</span></code> is intended for relative measurement and should use the method that gives the most precise time differences over the course of the program. Its return value must never decrease between calls.</p>
+<p><code><span class='Modifier'>•_timed</span></code> returns the total time taken divided by the number of function calls, including the overhead required for the outer loop that counts iterations (which will typically by negligible in comparison to the BQN code).</p>
+<p>More accurately the modifier <code><span class='Modifier2'>•_maxTime_</span></code> <em>may</em> fail if execution of <code><span class='Function'>𝔽</span></code> takes over <code><span class='Value'>𝕨</span><span class='Function'>𝔾</span><span class='Value'>𝕩</span></code> seconds, and should fail as quickly as it is practically able to. The most likely way to implement this modifier is to interrupt execution at the given time. If <code><span class='Function'>𝔽</span></code> completes before the interrupt there is no need to measure the amount of time it actually took.</p>