• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

The code below is a solution to improve the performance of your computer (1 Viewer)

Currently reading:
 The code below is a solution to improve the performance of your computer (1 Viewer)

Recently searched:

Tipoine08

Member
LV
2
Joined
Feb 1, 2023
Threads
10
Likes
5
Awards
6
Credits
3,432©
Cash
0$
Capture dcran 2023 02 08  150541
Capture dcran 2023 02 08  150559
Capture dcran 2023 02 08  150607

# import the necessary libraries import time import os # create a function to measure performance def performance_measure(): """ This function will measure the performance of the computer and compare it to the last result. """ # get the current system performance start_time = time.time() current_sys_perf = os.system("sar -u 1 1") # get the last system performance last_sys_perf = os.system("sar -u 2 1") # compare the results if current_sys_perf > last_sys_perf: # print out the improvement print("Performance has improved by {}%".format((current_sys_perf/last_sys_perf)*100)) else: # print out the decrease print("Performance has decreased by {}%".format((last_sys_perf/current_sys_perf)*100)) # call the performance_measure() function performance_measure()
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom