Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: third_party/twisted_8_1/twisted/test/threading_latency.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/test/threading_latency.py
diff --git a/third_party/twisted_8_1/twisted/test/threading_latency.py b/third_party/twisted_8_1/twisted/test/threading_latency.py
deleted file mode 100644
index 719f9b5b965c9d0564e10205b801ee36861eacd8..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/test/threading_latency.py
+++ /dev/null
@@ -1,54 +0,0 @@
-"""Measure latency of reactor thread APIs. run with runtests."""
-
-from pyunit import unittest
-import time
-
-from twisted.internet import reactor, threads
-
-
-class LatencyTestCase(unittest.TestCase):
-
- numRounds = 5
-
- def setUp(self):
- self.from_times = []
- self.in_times = []
-
- def tearDown(self):
- threads.shutdown()
-
- def wait(self):
- start = time.time()
- while time.time() - start < 1:
- reactor.iterate(1.0)
-
- def printResult(self):
- print
- print
- print "callFromThread latency:"
- sum = 0
- for t in self.from_times: sum += t
- print "%f millisecond" % ((sum / self.numRounds) * 1000)
-
- print "callInThread latency:"
- sum = 0
- for t in self.in_times: sum += t
- print "%f millisecond" % ((sum / self.numRounds) * 1000)
- print
- print
-
- def testCallFromThread(self):
- for i in range(self.numRounds):
- reactor.callInThread(self.tcmf_2, time.time())
- self.wait()
- assert len(self.in_times) == len(self.from_times)
- assert len(self.in_times) == self.numRounds
- self.printResult()
-
- def tcmf_2(self, start):
- # runs in thread
- self.in_times.append(time.time() - start)
- reactor.callFromThread(self.tcmf_3, time.time())
-
- def tcmf_3(self, start):
- self.from_times.append(time.time() - start)
« no previous file with comments | « third_party/twisted_8_1/twisted/test/testutils.py ('k') | third_party/twisted_8_1/twisted/test/time_helpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698