[code.view]

[top] / python / PyMOTW / time / time_clock.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """The difference between clock and time.
     """
     #end_pymotw_header
     
     import hashlib
     import time
     
     # Data to use to calculate md5 checksums
     data = open(__file__, 'rt').read()
     
     for i in range(5):
         h = hashlib.sha1()
         print time.ctime(), ': %0.3f %0.3f' % (time.time(), time.clock())
         for i in range(100000):
             h.update(data)
         cksum = h.digest()
     

[top] / python / PyMOTW / time / time_clock.py

contact | logmethods.com