diff options
Diffstat (limited to 'spec/system.md')
| -rw-r--r-- | spec/system.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/system.md b/spec/system.md index c08ab9af..11814fea 100644 --- a/spec/system.md +++ b/spec/system.md @@ -104,3 +104,19 @@ Each function in this section is monadic. | Right partial | 7 | ` 𝕣,𝕘` ## Timing + +| Name | Summary +|---------------|-------------------------- +| `•UnixTime` | Time between Unix epoch and function call +| `•MonoTime` | Monotonically-increasing time counter for relative measurement +| `•Delay` | Wait at least `𝕩` seconds, and return the actual wait time +| `•_timed` | Call `𝔽` on `𝕩` `𝕨⊣1` times, and return the average duration +| `•_maxTime_` | Call `𝔽` on the arguments, but fail if it takes over `𝕨𝔾𝕩` seconds + +All times are measured in seconds. + +The [Unix epoch](https://en.wikipedia.org/wiki/Unix_time) is 1970-01-01 00:00:00 UTC. `•UnixTime` is intended for absolute time measurement and should be implemented with the method that gives the most accurate result at any given time. `•MonoTime` 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. + +`•_timed` 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). + +More accurately the modifier `•_maxTime_` *may* fail if execution of `𝔽` takes over `𝕨𝔾𝕩` 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 `𝔽` completes before the interrupt there is no need to measure the amount of time it actually took. |
