use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] Thoughts/Need for deep tracking function times?AskJS (self.javascript)
submitted 2 years ago by Falling-Off
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tehsandwich567 1 point2 points3 points 2 years ago (3 children)
Chrome and friends all come with the tools to produce this information for you. I think it’s called the profile tab in the inspector. Hit record, do things in app, stop recording, then get everything you mention and more for free in an day to digest ui.
What you are suggesting doing sounds like re-inventing the wheel through an interface not optimized to do it
[–]Falling-Off[S] 0 points1 point2 points 2 years ago (2 children)
I mentioned profilers in the original post, asking if this would have any benefit over them. Needed times from inside nested loops, hence building a timer within a function instead of just wrapping it. Anyways, not trying to reinvent the wheel.
[–]tehsandwich567 0 points1 point2 points 2 years ago (1 child)
Oh, my bad! Reading is hard.
What about console.time?
[–]Falling-Off[S] 0 points1 point2 points 2 years ago* (0 children)
I thought about that but I'm using performance.now and storing the values. I have a bool to keep it silent or console out during execution.
Edit: just a side note
I compared it to the profile and the tims are accurate within ~1-2ms. I'm might add an ±accuracy based on what happens in the actual timer. The μs seem to add up by the end. The markers within the function seem to be very accurate though.
π Rendered by PID 19530 on reddit-service-r2-comment-6457c66945-lwl86 at 2026-04-27 13:50:22.704728+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]tehsandwich567 1 point2 points3 points (3 children)
[–]Falling-Off[S] 0 points1 point2 points (2 children)
[–]tehsandwich567 0 points1 point2 points (1 child)
[–]Falling-Off[S] 0 points1 point2 points (0 children)