Difference between revisions of "Performancescript"
(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...) |
|||
Line 1: | Line 1: | ||
+ | <pre> | ||
#!/usr/bin/python | #!/usr/bin/python | ||
import os | import os | ||
Line 19: | Line 20: | ||
print "" | print "" | ||
print "Total time to write", i,"files is == ",wtotal | print "Total time to write", i,"files is == ",wtotal | ||
+ | </pre> |
Latest revision as of 18:08, 30 January 2009
#!/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