How to get time (milisecond) of a python IO execution

This is the place for queries that don't fit in any of the other categories.

How to get time (milisecond) of a python IO execution

Postby tbaror » Sat Sep 14, 2013 9:33 pm

Hi All

i am trying to test measure some IO execution in milliseconds , but bit confuse about best method achive that under windows 7
i am using following code but not sure if its best or correct way since i have two different results, which one should i take as results
and which is best way
please advice
Thanks

100000000 loops, best of 3: 0.00925 usec per loop
3.827947176762156



Code: Select all
import timeit ,time
import datetime
import os


def main():
   
   
    os.path.getsize("c:/video-2011-09-09-09-32-29.mp4")
   

if __name__ == '__main__':

    t = timeit.Timer('main()')

    print (t.timeit(1))
tbaror
 
Posts: 13
Joined: Sun Jul 07, 2013 8:06 pm

Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], W3C [Linkcheck] and 3 guests