Commits

Chris Klimas committed 0373d13

Tweak performance instrument display

Comments (0)

Files changed (1)

zoetrope/debug/performance.lua

 	width = 'narrow',
 	contentHeight = 30,
 	samples = {},
-	sampleInterval = 0.1,
+	sampleInterval = 0.25,
 	samplePtr = 1,
-	numSamples = 210,
+	numSamples = 105,
 	_sampleTimer = 0,
 	_sampleBars = {},
 	average = '-',
 
 	onUpdate = function (self, elapsed)
 		self._sampleTimer = self._sampleTimer + elapsed
+		local fps = math.floor(1 / elapsed + 0.5)
+		self.title.text = 'FPS (' .. fps .. ', average ' .. self.average .. ')'
 
 		if self._sampleTimer > self.sampleInterval then
 			-- record fps and percent of desired fps
 
-			local fps = math.floor(1 / elapsed + 0.5)
-
 			table.insert(self.samples, fps)
 			table.insert(self.samples, fps / the.app.fps)
 
 				end
 			end
 
-			self.title.text = 'FPS (' .. fps .. ', average ' .. self.average .. ')'
 			self._sampleTimer = 0
 		end
 	end,