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

Correct tick count in profiler output. #19

Merged
merged 1 commit into from
May 11, 2017
Merged

Conversation

Genhis
Copy link
Contributor

@Genhis Genhis commented Mar 16, 2017

#8: Fixed a bug when Game.profiler.output() showed incorrect Avg and Ticks numbers.

@Genhis Genhis force-pushed the issue_8 branch 2 times, most recently from 6b74d4e to f9e86bd Compare March 16, 2017 19:33
Copy link
Collaborator

@gdborton gdborton left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, sorry for the delay in reviewing. If you can break up that line, I'll get this merged in pretty quick.

@@ -147,7 +147,8 @@ const Profiler = {
return 'Profiler not active.';
}

const elapsedTicks = Game.time - Memory.profiler.enabledTick + 1;
const elapsedTicks = (Memory.profiler.type === 'background' ? Game.time :
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you split this line up? Maybe a const endTick = ... the two line ternary isn't terribly easy to read.

@gdborton gdborton changed the title Fixes issue #8 Correct tick count in profiler output. May 11, 2017
Prevously calling `Game.profiler.output()` after a profile had finished running
would generate a report with the wrong ending tick.  This adds logic to make
the disableTick the ending tick for the profiler report leading to accurate
numbers.
@gdborton gdborton merged commit af21308 into screepers:master May 11, 2017
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