ludic.nav (17.10): the time paths take, counted in the shim
nav_us() gives the microseconds spent in nav_path across the loaded meshes. The shim times each path with the OS's monotonic clock (clock_gettime, or QueryPerformanceCounter from KERNEL32), so the DLL still needs no C++ runtime. Both libraries are rebuilt, and 13 tests pass on the Mac and the PC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
297578705e
commit
f65eda8b47
9 changed files with 58 additions and 9 deletions
|
|
@ -47,6 +47,15 @@ export function nav_path(nav_st: mut NavState, kind: int, filter: int, sx: float
|
|||
export function nav_asked(nav_st: NavState) -> int { return nav_st.nv_asked }
|
||||
export function nav_found(nav_st: NavState) -> int { return nav_st.nv_found }
|
||||
export function nav_short(nav_st: NavState) -> int { return nav_st.nv_short }
|
||||
# microseconds spent finding those paths, over every loaded mesh
|
||||
export function nav_us(nav_st: NavState) -> int {
|
||||
var us = 0
|
||||
for k in 0 .. NAV_KINDS {
|
||||
let h = nv_mesh(nav_st, k)
|
||||
if h != null { us += nvc_us(h) }
|
||||
}
|
||||
return us
|
||||
}
|
||||
export function nav_partial(nav_st: NavState, kind: int) -> bool {
|
||||
let h = nv_mesh(nav_st, kind)
|
||||
return h != null and nvc_partial(h) == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue