whatwg / console

Console Standard
https://console.spec.whatwg.org/
Other
272 stars 69 forks source link

Timing and Counting methods should report warnings when necessary #134

Open domfarolino opened 6 years ago

domfarolino commented 6 years ago

Right now console.time() mentions an optionally-reported warning on trying to start an already-existing timer. We should strengthen this by implementing some sort of formal error-reporting method (#57) and making the warning mandatory.

Furthermore, console.timeEnd() in all implementations (can't remember Edge's behavior though) prints a warning when trying to end a non-existent timer. To bring the spec closer to implementations, and also align timeEnd() with countReset (currently being specced), I propose make timeEnd() also report an warning under the previously-mentioned conditions.

Edit

In short: