Skip to content
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

Measuring timings over a longer duration #7

Open
leod opened this issue Oct 25, 2015 · 1 comment
Open

Measuring timings over a longer duration #7

leod opened this issue Oct 25, 2015 · 1 comment

Comments

@leod
Copy link

leod commented Oct 25, 2015

As I understand it, the time measurements in hprof are reset at the start of each frame. print_timing() will print the timings of just the last frame.

I think it could be useful to measure timings for a longer duration (e.g. 1 second), optionally. For one thing, this would possibly smooth out random fluctuations in the timings.

Secondly, in my use case, I have some functions that are called periodically (e.g. starting a new game tick 20 times a second), but not necessarily every frame. So in the print_timing() output, I'll get either 0% or the percentage of time in the last frame for these periodical functions. Here, I think it would be useful to instead get the time taken in e.g. the last second.

@daniel-vainsencher
Copy link

Wait what? ;)

In my case, also, what I care about is total time spent under a node, over all frames, not just the last frame. In fact, I had implicitly assumed this is what the crate does and was surprised at all those "1"s in the call counts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants