Summary
test_gap_console_methods.ts exercises console.time / console.timeLog / console.timeEnd. The elapsed value prints as 0.005ms / 0.010ms where Node reports 1.271ms / 2.517ms. The actual work between calls is a real setTimeout(resolve, N) so the correct elapsed should be at least the sleep duration.
Actual vs Expected (excerpt)
< timer1: 0.005ms (perry)
> timer1: 1.271ms (node)
< timer1: 0.010ms (perry)
> timer1: 2.517ms (node)
Scope
console.time(label) stores the start time at performance.now() precision
console.timeLog(label) / console.timeEnd(label) compute now - start and format to ms with 3 decimals
- Perry's current impl appears to use a clock that either doesn't advance during the timer wait or uses the wrong monotonic source
Related: see #74 (Date.now not advancing during tight CPU loops — different root cause but similar symptom class).
Impact
One of six currently-failing gap tests (baseline 22/28). Likely 3-4 lines of runtime change in console.rs or builtins.rs.
Summary
test_gap_console_methods.tsexercisesconsole.time/console.timeLog/console.timeEnd. The elapsed value prints as0.005ms/0.010mswhere Node reports1.271ms/2.517ms. The actual work between calls is a realsetTimeout(resolve, N)so the correct elapsed should be at least the sleep duration.Actual vs Expected (excerpt)
Scope
console.time(label)stores the start time atperformance.now()precisionconsole.timeLog(label)/console.timeEnd(label)computenow - startand format to ms with 3 decimalsRelated: see #74 (Date.now not advancing during tight CPU loops — different root cause but similar symptom class).
Impact
One of six currently-failing gap tests (baseline 22/28). Likely 3-4 lines of runtime change in
console.rsorbuiltins.rs.