Want more features on Pastebin? Sign Up, it's FREE!
Guest

modified_main

By: a guest on Aug 18th, 2011  |  syntax: Python  |  size: 0.27 KB  |  views: 70  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def main():
  2.         buf = []
  3.         st = time.time()
  4.         while True:
  5.                 l, data = inp.read()
  6.                 buf.append(data)
  7.                 if len(buf) >= 20:
  8.                         end = time.time()
  9.                         print('elapsed: ' + str(end - st))
  10.                         out.write(buf[0])
  11.                         del buf[0]
  12.                         st = time.time()
  13.                        
  14.                 time.sleep(.001)
  15.         return
clone this paste RAW Paste Data