Metadata-Version: 2.1
Name: fpstimer
Version: 0.0.1
Summary: A clock timer that provides sleep()-like features for maintaining a certain "frames per second" (FPS) framerate in Python 2 and 3.
Home-page: https://github.com/asweigart/fpstimer
Author: Al Sweigart
Author-email: al@inventwithpython.com
License: GPLv3+
Description: # fpstimer
        
        A clock timer that provides sleep()-like features for maintaining a certain "frames per second" (FPS) framerate in Python 2 and 3.
        
        Sometimes you'll want to slow down your computer so it doesn't run too fast for the user. For example, if you want to run a video game at 60 frames per second (FPS), but the game can render the graphics for the screen in less than 1/60 second, you'll need the program to pause for however much time is remaining in that 1/60 second. This varible amount of time can be calculated by FPS Timer.
        
        Install
        =======
        
            pip install fpstimer
        
        Usage
        =====
        
        The frame rate is set by passing the integer FPS to the FPSTimer() constructor. The FPSTimer object has an sleep() method that pauses for a variable amount of time needed to maintain that framerate.
        
        For example, calling FPSTimer(10) creates a timer for 10 fps. Each "frame" should last for 1/10 of a second. Running your program without an FPS timer could cause your program to run too fast for the user, especially as CPUs get faster. After running the code for a single frame, calling sleep() will pause the program for however much is needed for the remaining 1/10 second for that frame. This pause is calculated from the last time that sleep() was called for the previous frame.
        
            >>> import fpstimer
            >>> timer = fpstimer.FPSTimer(60) # Make a timer that is set for 60 fps.
            >>> for i in range(100): # Each iteration of this loop will last (at least) 1/60 of a second.
            ...     # Do calculations/work for a single "frame" here.
            ...     timer.sleep() # Pause just enough to have a 1/60 second wait since last fpstSleep() call.
        
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown
