feat(tools): L10 ludic-fmt enforces a project's style
lint lines in package.ludic - one_statement, max_file_lines, max_function_lines, max_comment_lines, max_header_lines, paths, baseline - checked by ludic-fmt --check <files> and ludic-fmt --lint (the project), at the line; a baseline ratchet lets a rule arrive in a codebase that breaks it (--init-baseline), lowered as it is fixed. check-impl reads the alias declarations too (it had been blind to every namespace L6 moved out of the compiler), and eight methods get their pages; a test holds the formatter to keeping type arguments together (L5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e543525eb7
commit
334469ef61
16 changed files with 635 additions and 2 deletions
23
docs/language/time/time-now_us.md
Normal file
23
docs/language/time/time-now_us.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
id: time-now_us
|
||||
name: Time.now_us
|
||||
category: time
|
||||
kind: namespace-method
|
||||
tokens: Time.now_us
|
||||
sig: Time.now_us() -> long
|
||||
tip: A microsecond clock, for measuring.
|
||||
order: 7
|
||||
ns: Time
|
||||
member: now_us
|
||||
---
|
||||
|
||||
Returns a steady microsecond count from the platform clock, for timing a piece of work - the difference between two readings is how long it took. It is not the game's time (that is <a href="time-now"><code>Time.now</code></a>) and it does not stop when the game is paused.
|
||||
|
||||
```ludic
|
||||
program Timed {
|
||||
entry {
|
||||
let t0 = Time.now_us()
|
||||
print(Time.now_us() - t0)
|
||||
}
|
||||
}
|
||||
```
|
||||
26
docs/language/time/time-sleep_us.md
Normal file
26
docs/language/time/time-sleep_us.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
id: time-sleep_us
|
||||
name: Time.sleep_us
|
||||
category: time
|
||||
kind: namespace-method
|
||||
tokens: Time.sleep_us
|
||||
sig: Time.sleep_us(us)
|
||||
tip: Waits this many microseconds.
|
||||
order: 8
|
||||
ns: Time
|
||||
member: sleep_us
|
||||
---
|
||||
|
||||
Suspends the program for about `us` microseconds - a high-resolution wait, for pacing a loop to a frame rate. No operating system's sleep is exact, so a limiter sleeps most of the wait and spins the last of it.
|
||||
|
||||
Parameters:
|
||||
- `us` — how long to wait, in microseconds (a `long`)
|
||||
|
||||
```ludic
|
||||
program Paced {
|
||||
entry {
|
||||
Time.sleep_us(1000)
|
||||
print(1)
|
||||
}
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue