I need to know how much this particular line of code loads my cpu when whole program is executed:
cap.set(cv.CAP_PROP_POS_FRAMES,random_frame)
This line is part of a certain program. But I'm only interested in how this particular line loads the cpu. I don't know exactly how to measure it.
To be more precised, this is my full code:
import cv2 as cv
import random
cap = cv.VideoCapture('file_name.avi')
random_frame = random.randint(1,99999)
cap.set(cv.CAP_PROP_POS_FRAMES,random_frame)
ret, frame = cap.read()
cv.imshow("random_frame",frame)
while cap.isOpened():
if cv.waitKey(1) == ord('q'):
break
cap.release()
cv.destroyAllWindows()
Windows 7 operating system