runner_performance.py 649 B

123456789101112131415161718192021222324
  1. '''
  2. Created on 27-jul.-2014
  3. @author: Simon
  4. '''
  5. import Tkinter as tk
  6. import target_py.target_performance as target
  7. from sccd.runtime.libs.ui import ui
  8. from sccd.runtime.statecharts_core import Event
  9. from sccd.runtime.tkinter_eventloop import *
  10. if __name__ == '__main__':
  11. ui.window = tk.Tk()
  12. ui.window.withdraw()
  13. def callback(ctrl, behind_schedule):
  14. if behind_schedule > 2000:
  15. print len(ctrl.object_manager.instances)
  16. ctrl.stop()
  17. ui.window.destroy()
  18. controller = target.Controller(TkEventLoop(ui.window), behind_schedule_callback=callback)
  19. controller.start()
  20. ui.window.mainloop()