The code below is a solution to improve the performance of your computer | Tips/Suggestions | Crax

Welcome To Crax.Pro Forum!

Check our new Marketplace at Crax.Shop

   Login! SignUp Now!
  • We are in solidarity with our brothers and sisters in Palestine. Free Palestine. To learn more visit this Page

  • Crax.Pro domain has been taken down!

    Alternatives: Craxpro.io | Craxpro.com

The code below is a solution to improve the performance of your computer

The code below is a solution to improve the performance of your computer

LV
1
 

Tipoine08

Member
Joined
Feb 1, 2023
Threads
10
Likes
5
Awards
4
Credits
3,403©
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
Tips

Similar threads

Top Bottom