Commit Graph

4 Commits

Author SHA1 Message Date
MarcZX100 1a793b3698 test(libkernel): tolerate process-time clock skew 2026-10-11 10:46:48 +00:00
Achraf Reyani 0eaf2ec159 test(libkernel): wait until 50 ms have passed before the first process time read
sleep_for can return up to a scheduler tick early against the
performance counter the guest clock reads, so the first reading could be
just under 50 ms on a loaded machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:51:47 +09:00
Zurisen 9ebc657f82 fix(libkernel): count process time from library load
sceKernelGetProcessTime and sceKernelGetProcessTimeCounter measured from
a start captured on their first call, so the first reading was about 0
however long the process had run, and exactly 0 when both reads fell in
one tick of the host clock (100 ns on Windows). Capture the start when
libkernel loads.
2026-10-11 18:13:30 +09:00
TideOPL 383770ff65 fix(libkernel): read the process start before the clock in process time
sceKernelGetProcessTime and sceKernelGetProcessTimeCounter subtracted
GetStartNanos() from GetMonotonicNanos() in one expression. GCC reads the
clock first, so on the first call in a process the start was captured
after it and the result wrapped to about 2^64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:59:30 +01:00