Skip to content

Commit

Permalink
Fixing divition by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Dec 16, 2024
1 parent 1c11ff2 commit 9f2271f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Bloc-DevTool/BlSpaceStatistics.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,17 @@ BlSpaceStatistics >> totalTime [
{ #category : #private }
BlSpaceStatistics >> updateValues [

| currentIncrementalGCCount currentMillisecond currentFullGCCount |
| currentIncrementalGCCount currentMillisecond currentFullGCCount secondPassed |
currentMillisecond := Time millisecondClockValue.

totalTime := totalTime + (currentMillisecond - previousMillisecond).

fps := (currentFrames/ (currentMillisecond - previousMillisecond / 1000)) asFloat.
secondPassed := (currentMillisecond - previousMillisecond) / 1000.

fps := secondPassed = 0
ifTrue: [ 0 ]
ifFalse: [ (currentFrames / secondPassed) asFloat ].

fpsSamples add: { currentMillisecond. fps }.
previousMillisecond := currentMillisecond.
currentFrames := 0.
Expand Down

0 comments on commit 9f2271f

Please sign in to comment.