mirror of https://github.com/kivy/kivy.git
kvrun: show FPS every one second
This commit is contained in:
parent
bb891ef2de
commit
da7486cafe
|
@ -1,10 +1,14 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.clock import Clock
|
||||
from kivy.lang import Builder
|
||||
|
||||
class KvApp(App):
|
||||
def _print_fps(self, *largs):
|
||||
print 'FPS:', Clock.get_fps()
|
||||
def build(self):
|
||||
Clock.schedule_interval(self._print_fps, 1)
|
||||
return Builder.load_file(self.options['filename'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue