Skip to content

Measuring timings over a longer duration #7

Description

@leod

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions