-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console.time() multiple times with the same label #103
Comments
Simple test: https://jsbin.com/jaduboh/edit?js,output Chrome + Canary: Resets an already existing timer on calls to I think the behavior of multiple calls to |
Edge does not reset and gives a little warning message. I'd go for:
However I think there's another issue here which is whether timeEnd() removes the timer from the timer table, thus allowing a new timer to start. Test: https://jsbin.com/biyucoxuqa/1/edit?js,output
|
Another test about where timeEnd() removes: https://jsbin.com/jewoxec/edit?js,output
|
I can wait for #105 to get merged and then add text in the
I might be misunderstanding the intention of your two tests, but in your first test case you indicate that chrome removes a timer from the table on timeEnd(), but then in the next indicate that it doesn't right? Also, I believe this is tracked here #84 fwiw. In that issue it seems like we're either going to go with allowing multiple calls to timeEnd(), or adding something like an intermediate timeLog(). Personally I think the shortest path to interop would be to make the timeLog() since no other implementations support multiple calls to timeEnd() (the less intuitive way to log an intermediate value IMO), but I can try and push that in that issue as opposed to here if that sounds good. edit: regardless to answer your question marks, Safari does remove timers from table on calls to timeEnd() and prints a warning if the timer is not in the table |
Sounds like a great plan. A separate PR on top of #105 makes sense to me.
Yes. Basically Chrome's behavior makes no sense to me. I can come up with weird models that explain it I guess, but it's not great.
Sounds good. |
The current spec seems to imply this will reset the timer, but at least in some of my tests, it does not seem to. We should get to the bottom of this, and write some (manual) web platform tests.
The text was updated successfully, but these errors were encountered: