3 Test N3 to time file reading
7 from clock import clock
8 from m_lib.pbar.tty_pbar import ttyProgressBar
15 size = os.path.getsize(sys.argv[1])
16 infile = open(sys.argv[1])
17 pbar = ttyProgressBar(0, size)
23 # This is for DOS - it counts CRLF, which len() counts as 1 char!
24 if os.name == 'dos' or os.name == 'nt' :
27 dos_add = 0 # UNIX' and Mac's len() counts CR or LF correct
30 line = infile.readline()
33 lng = lng + len(line) + dos_add
42 if __name__ == "__main__":
44 print "Overall time:", clock()