Skip to content

Add gloo-console-timer #32

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

Merged
merged 8 commits into from
Mar 22, 2019
Merged

Add gloo-console-timer #32

merged 8 commits into from
Mar 22, 2019

Conversation

cbrevik
Copy link
Contributor

@cbrevik cbrevik commented Mar 19, 2019

Resolves #16

Adds the gloo-console-timer crate with the ConsoleTimer RAII type.

Docs feature the preferred scope-method for measurement:

let value = ConsoleTimer::scope("foo", || {
    // Place code to be measured here
});

Was a bit unsure how to write tests here, since it seems I cannot verify through tests that the measurement including label is printed to the console.

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Happy to merge with nitpicks below addressed.

Yeah hard to test since the effects aren't visible to us. I think what you have written is fine.

Thanks @cbrevik!

@cbrevik
Copy link
Contributor Author

cbrevik commented Mar 20, 2019

Addressed feedback, but I see one of the doc tests doesn't build, so will have to fix that first. (The one using gloo_timers).

@cbrevik
Copy link
Contributor Author

cbrevik commented Mar 20, 2019

Maybe there is a better way to handle this than to ignore the test?

I didn't want to add dependencies just to make that example compile.

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cbrevik!

@fitzgen fitzgen merged commit 3d26cd4 into rustwasm:master Mar 22, 2019
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

Successfully merging this pull request may close these issues.

2 participants