smarts.core.utils.frame_monitor module

class smarts.core.utils.frame_monitor.FrameMonitor(desired_fps=10)[source]

A tool for requiring a minimum frame rate.

start()[source]

Starts timing the frame.

stop()[source]

Ends timing the frame. Throws an exception if the frame duration is greater than desired fps.

exception smarts.core.utils.frame_monitor.FramerateException[source]

An exception raised if frame rate has increased higher than the desired threshold.

classmethod below_threshold(desired_fps, delta)[source]

Generate a frame-rate exception. :param desired_fps: The intended fps. :param delta: The frame time taken.

Returns:

A new frame-rate exception.