Closed Bug 1463347 Opened 6 years ago Closed 5 years ago
Add distinction between time
Log and time End messages
47 bytes, text/x-phabricator-request
|Details | Review|
I know that timeLog can have multiple arguments to clarify what call it refers to, but if none provided, it's a bit hard to follow what's going on. The following code: ```js console.time("bar"); console.timeLog("bar"); console.timeLog("bar"); console.timeEnd("bar"); ``` will output: > bar: 1ms > bar: 2ms > bar: 3ms I feel like the timeEnd should have either a different label, or an icon or something that indicate that it _is_ the timeEnd. For example: > bar: 1ms > bar: 2ms > bar: 3ms - timer ended I'm really not sure about the naming and the style of it though. Victoria, would you have some thoughts on this ?
Hi Nicolas! That message sounds good. I noticed that this page (https://developer.mozilla.org/en-US/docs/Web/API/console#Timers) mentions there's also a 'Timer started' message which appears on its own line - this seems like it would be nice for the timer ended message too (unless that makes it seem to have a different meaning of less immediacy or something). Maybe an icon like https://design.firefox.com/icons/viewer/#info (or possibly even https://design.firefox.com/icons/viewer/#history) and Gray 50 color would help to set it apart. If we can't have icons here, it could have brackets or other text decoration instead: [Timer ended]
Haha, the emoji I put in that comment destroyed my example text - I was suggesting it could look something like this: [i] Timer started bar: 1ms bar: 2ms bar: 3ms [i] Timer ended
(In reply to Victoria Wang [:victoria] from comment #2) > Haha, the emoji I put in that comment destroyed my example text - I was > suggesting it could look something like this: > > [i] Timer started > bar: 1ms > bar: 2ms > bar: 3ms > [i] Timer ended We don't have the "timer started" message anymore (but we can have it back). Icons would be nice, I'll put up a quick patch to try them and put screenshots here. The last thing is that in this mockup we have 2 "messages" in response to `console.timeEnd("bar")`: - The actual timer - The message saying that the timer has ended I'd prefer if we only have one. So maybe it could look like [i] Timer <bar> started bar: 1ms bar: 2ms [i] Timer <bar> ended: 3ms ?
Ah, I see what you mean about needing to have those two messages grouped. Yes, this sounds good. Actually, now that I realize the timer end needs to be next to the 3ms, I like your first suggestion as well, since it's nice to have the seconds lined up. The 'timer started' message doesn't necessarily need to be added back in unless you think it's helpful. Will defer to you on how to proceed here :).
Assignee: nobody → solaocodes
Status: NEW → ASSIGNED
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/0d9daf8104d7 Add distinction between timeLog and timeEnd messages r=nchevobbe
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/0c4c0810b93f Add distinction between timeLog and timeEnd messages r=nchevobbe
You need to log in before you can comment on or make changes to this bug.