Skip to content

Commit

Permalink
filter out 0.0 and 0 values from the list
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindNilas committed Jun 18, 2024
1 parent dddc8fb commit fcd87d7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,17 @@ def parseFPS():
with open("log.txt", "r") as file:
output = file.read()
matches = re.findall(r"fps=\s*([\d.]+)", output)
if matches:
highest_fps = max(map(float, matches))
average_fps = round(sum(map(float, matches)) / len(matches), 2)
print("Highest FPS:", highest_fps, "Average FPS:", average_fps)
return average_fps
# Filter out fps values that are 0.0 or 0
filtered = [float(fps) for fps in matches if float(fps) > 0]
if filtered:
highestFPS = max(filtered)
averageFPS = round(sum(filtered) / len(filtered), 2)
print("Highest FPS:", highestFPS, "Average FPS:", averageFPS)
return averageFPS
else:
print("None")
print("Couldn't identify FPS value. Skipping...")
return None


def parseSystemInfo():
systemInfo = {}
with open("log.txt", "r") as file:
Expand Down

0 comments on commit fcd87d7

Please sign in to comment.