Add profiling

develop
Sven Slootweg 12 years ago
parent c5e5913b4c
commit 70c701a00f

@ -1,12 +1,16 @@
import pyreactor, time
from testclient import TestClient
import cProfile as profile
s = pyreactor.Server("127.0.0.1", 4006, TestClient)
c = TestClient(host="127.0.0.1", port=4006)
def main():
s = pyreactor.Server("127.0.0.1", 4006, TestClient)
c = TestClient(host="127.0.0.1", port=4006)
c.send({"test": "just sending some test data...", "number": 41, "file": open("testdata.dat", "rb")})
c.send({"test": "just sending some test data...", "number": 41, "file": open("testdata.dat", "rb")})
reactor = pyreactor.Reactor()
reactor.add(s)
reactor.add(c)
reactor.loop()
reactor = pyreactor.Reactor()
reactor.add(s)
reactor.add(c)
reactor.loop()
profile.run("main()")

Loading…
Cancel
Save