Skip to content

Add ability to time simplifyTemplates.#1640

Merged
danmar merged 1 commit into
cppcheck-opensource:masterfrom
IOBYTE:master
Feb 1, 2019
Merged

Add ability to time simplifyTemplates.#1640
danmar merged 1 commit into
cppcheck-opensource:masterfrom
IOBYTE:master

Conversation

@IOBYTE
Copy link
Copy Markdown
Contributor

@IOBYTE IOBYTE commented Feb 1, 2019

No description provided.

@amai2012
Copy link
Copy Markdown
Collaborator

amai2012 commented Feb 1, 2019

Not-specific to this commit, but it's error prone that a simple timer output requires code to be duplicated.
Something like

{
            Timer t("Tokenizer::tokenize::simplifyTemplates", mSettings->showtime, mTimerResults), mTimerResults;
            simplifyTemplates();
 }

would be better imho.

@IOBYTE
Copy link
Copy Markdown
Contributor Author

IOBYTE commented Feb 1, 2019

I just did a cut and paste. I didn't even look at what Timer does. I just assumed it was written that way because Timer has high overhead (doesn't have a no-op mode).

What you propose makes sense if Timer has no overhead when not enabled.

@danmar danmar merged commit 5c0ec78 into cppcheck-opensource:master Feb 1, 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.

3 participants