Question: Question: In Python Develop a Hard drive benchmark (reference time: 250 seconds) o Read a whole file of 10**9 bytes, 100 bytes each time o

Question:

In Python Develop a Hard drive benchmark (reference time: 250 seconds)

o Read a whole file of 10**9 bytes, 100 bytes each time

o Write10**9 bytes to a file, 100 bytes each time

-----------------------------------------

code not functioning:

import time

start_time = time.time()

#hard drive operations with open("file.txt", "wb") as f: for i in range(10**9): f.write(b"0" * 100) with open("file.txt", "rb") as f: for i in range(10**9): x = f.read(100)

end_time = time.time()

execution_time = end_time - start_time

print("Execution time: ", execution_time)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!