Question: Question: In Python Develop a Hard drive benchmark (reference time: 10 seconds) o Read a whole file of 10**9 bytes,10000 bytes each time o Write10**9
Question:
In Python Develop a Hard drive benchmark (reference time: 10 seconds)
o Read a whole file of 10**9 bytes,10000 bytes each time
o Write10**9 bytes to a file, 10000 bytes each time
--------------------------------------
code not functioning:
import time
start_time = time.time()
#hard drive operations same as last, more bytes with open("file.txt", "wb") as f: for i in range(10**9): f.write(b"0" * 1000) with open("file.txt", "rb") as f: for i in range(10**9): x = f.read(10000)
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
Get step-by-step solutions from verified subject matter experts
