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

Expose timer as a crate #367

Open
kuviman opened this issue Feb 10, 2021 · 4 comments
Open

Expose timer as a crate #367

kuviman opened this issue Feb 10, 2021 · 4 comments
Labels
question Further information is requested

Comments

@kuviman
Copy link

kuviman commented Feb 10, 2021

I was looking for an easy way to calculate cpu times for child processes in Rust, and the only cross platform option I have found is the timer module of this repository. I think it would be great if it was exposed as a separate crate for people to use.

@sharkdp
Copy link
Owner

sharkdp commented Feb 15, 2021

Thank you for the feedback. Sounds like a good idea! I'm not sure when/if I will get around to it though.

If someone wants to help, I would appreciate if we could first keep everything inside this repository, but prepare the code for extraction into a new crate (proper pub usage, documentation, tests, etc.). We could even move it into a separate crate within this repository.

@sharkdp
Copy link
Owner

sharkdp commented Jul 26, 2021

@kuviman Are you still interested in having this as a crate? Otherwise, I'd like to close this ticket.

Note that the hyperfine timer currently has a problem with user/system times on Windows (#368).

@sharkdp sharkdp added the question Further information is requested label Jul 27, 2021
@kuviman
Copy link
Author

kuviman commented Jul 28, 2021

I do still think that exposing as a crate would be useful. I myself did not need that functionality for long time but I might in the near future.

If I do look at it I may try and do this myself and make a PR here. This would involve fixing #368 too

If noone else is interested I guess you can close this but I think there is still no alternatives?

Also, if I remember correctly, I looked briefly at the code and I think this would require more work than just extracting the module into a crate to make it more general-purpose. I think on unix this calculates times of the whole process tree including the hyperfine process itself but I would only like to see info of a single particular child (sub-tree).

So maybe this is not proper place for this issue anyway, since you don't really need this for hyperfine, but as I said, having such functionality somewhere would be great

@sharkdp
Copy link
Owner

sharkdp commented Mar 5, 2022

I recently restructed the code base and cleaned up a lot, including the timer module. Now might be a good time to reconsider this.

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

No branches or pull requests

2 participants