(self)
Return the current FPS.
Return the current FPS.
Return the current FPS .
def get_fps(self):
        """Return the current FPS."""
        if len(self.times) >= 2:
            dif = np.diff(self.times)
            fps = 1. / dif.min()
            # if the FPS crosses 500, do not update it
            if fps <= 500:
                self.fps = fps
            return self.fps
        else:
            return 0.
def get_fps ( self ) : if len ( self . times ) >= 2 : dif = np . diff ( self . times ) fps = 1. / dif . min ( ) # if the FPS crosses 500, do not update it if fps <= 500 : self . fps = fps return self . fps else : return 0.