Difference between revisions of "Performancescript"

From CDOT Wiki
Jump to: navigation, search
(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...)
(No difference)

Revision as of 18:08, 30 January 2009

  1. !/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