home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 October / maximum-cd-2011-10.iso / DiscContents / digsby_setup.exe / lib / plugins / facebook / fbbenchmark.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-06-22  |  1.4 KB  |  34 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. from tests.testapp import testapp
  5. from time import clock
  6. import os.path as os
  7.  
  8. def benchmark(fbdata):
  9.     Storage = Storage
  10.     import util
  11.     account = Storage(protocol = 'fb20', connection = Storage(last_stream = fbdata['stream'], last_alerts = fbdata['alerts'], last_status = fbdata['status']))
  12.     FBIB = FBIB
  13.     import fb20.fbacct
  14.     
  15.     def doit():
  16.         before = clock()
  17.         FBIB(account, cache = False).get_html(None)
  18.         return clock() - before
  19.  
  20.     print 'first ', doit()
  21.     print 'second', doit()
  22.  
  23.  
  24. def main():
  25.     app = testapp()
  26.     import cPickle
  27.     fbdata_file = os.path.join(os.path.dirname(__file__), 'fbdata.dat')
  28.     fbdata = cPickle.loads(open(fbdata_file, 'rb').read())
  29.     benchmark(fbdata)
  30.  
  31. if __name__ == '__main__':
  32.     main()
  33.  
  34.