X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;ds=sidebyside;f=plomrogue%2Fio.py;h=8cba18d7a483664047b3601890fec3df2c4490a9;hb=441cf8d41a223e9bcd702d4ccb41ae679e6fcae3;hp=8110647647b1a809692949220135cf7eb9c4679d;hpb=fd98b77dfea09c0481b0e8be1204b6439eea80da;p=plomrogue2 diff --git a/plomrogue/io.py b/plomrogue/io.py index 8110647..8cba18d 100644 --- a/plomrogue/io.py +++ b/plomrogue/io.py @@ -43,7 +43,18 @@ class GameIO(): via self.queue from connected servers' clients.""" self.queue = queue.Queue() + + # optionally use this for main thread profiling: + # import cProfile + # class ProfiledThread(threading.Thread): + # def run(self): + # profiler = cProfile.Profile() + # profiler.runcall(threading.Thread.run, self) + # print('profiled thread finished') + # profiler.dump_stats('profile') + # c = ProfiledThread(target=self.loop, args=(self.queue,)) c = threading.Thread(target=self.loop, args=(self.queue,)) + c.start() def start_server(self, port, server_class, certfile=None, keyfile=None):