def benchmarkThread(self):
    pool = NSAutoreleasePool.alloc().init()
    self.spinner.startAnimation_(self)
    self.button.setEnabled_(False)
    self.UpdateStatus('Preparing benchmark')
    try:
      self.PrepareTestRecords()
      self.PrepareNameServers()
      self.PrepareBenchmark()
      self.RunAndOpenReports()
    except nameserver_list.OutgoingUdpInterception:
      (exc_type, exception, tb) = sys.exc_info()
      self.UpdateStatus('Outgoing requests were intercepted!',
                        error=str(exception))
    except nameserver_list.TooFewNameservers:
      (exc_type, exception, tb) = sys.exc_info()
      self.UpdateStatus('Too few nameservers to test', error=str(exception))
    except conn_quality.OfflineConnection:
      (exc_type, exception, tb) = sys.exc_info()
      self.UpdateStatus('The connection appears to be offline!', error=str(exception))
    except:
      (exc_type, exception, tb) = sys.exc_info()
      traceback.print_exc(tb)
      error_msg = '\n'.join(traceback.format_tb(tb)[-4:])
      self.UpdateStatus('FAIL: %s' % exception, error=error_msg)

    self.spinner.stopAnimation_(self)
    self.button.setEnabled_(True)
    # This seems weird, but recommended by http://pyobjc.sourceforge.net/documentation/pyobjc-core/intro.html
    del pool
Run the benchmarks, designed to be run in a thread.
dataset/ETHPy150Open catap/namebench/cocoa/controller.py/controller.benchmarkThread