import text from '../drawers/text'

let fpsItems = []
let current

const fps = () => {
	current = performance.now()
	fpsItems = fpsItems.filter(_ => _ >= current - 1000)
	fpsItems.push(current)

	text({ text: fpsItems.length + ' fps' })
}

export default fps
