Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

print fps in while loop python

import time

start_time = time.time()
x = 1 # displays the frame rate every 1 second
counter = 0
while True:

    ########################
    # your fancy code here #
    ########################

    counter+=1
    if (time.time() - start_time) > x :
        print("FPS: ", counter / (time.time() - start_time))
        counter = 0
        start_time = time.time()
Comment

PREVIOUS NEXT
Code Example
Python :: import math print(m.cos(10)) 
Python :: na.kalman in python 
Python :: how to access a variable from another py file in vs code 
Python :: python exit while loop 
Python :: python measure volum from audio file 
Python :: python print to string 
Python :: extrapolate python 
Python :: Empty a variable without destroying it 
Python :: sidetable github 
Python :: best movies to watch once in lifetime 2000 
Python :: np.nditer 
Python :: how to upload to PyPi with same name 
Python :: Build the union of a list of RDDs 
Python :: Applies the f function to all Row 
Python :: pip img2pdf 
Python :: sqlite3 with flask web application CRUD pdf 
Python :: mask and then fillnan# 
Python :: python library automatic sort 
Python :: pandas seaborn distplot 
Python :: fill misssing values using sklrean 
Python :: how to use idl in python 
Python :: from flask_paginate import get_page_parameter 
Python :: elevando numero ao quadrado em python 
Python :: convert to pdf fresh little library that outputs our notebook in a nice LaTex format without installing/doing anything else. 
Python :: allala rara 
Python :: features and image recongnition 
Python :: python array of last n months 
Python :: latch in rospy.publisher 
Python :: loess dataframe 
Python :: region error when use service account json file dataproc 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =