Open main menu

CDOT Wiki β

Changes

Performancescript

478 bytes added, 18:08, 30 January 2009
New page: #!/usr/bin/python import os import time i=0 wtime1 = time.mktime(time.localtime()) while True: filename = 'dsktst' + str(i) f = file(filename, 'w') os.system("dd i...
#!/usr/bin/python
import os
import time

i=0
wtime1 = time.mktime(time.localtime())
while True:
filename = 'dsktst' + str(i)
f = file(filename, 'w')
os.system("dd if=/dev/zero of="+filename+" bs=1024 count=100")
f.close( )
i = i + 1
if i == 10000:
break
os.system("sync")
wtime2 = time.mktime(time.localtime())
wtotal = wtime2 - wtime1
print ""
print ""
print "Total time to write", i,"files is == ",wtotal
1
edit