MCPcopy Index your code
hub / github.com/python/cpython / decide_itimer_count

Method decide_itimer_count

Lib/test/test_signal.py:1254–1266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1252 return med
1253
1254 def decide_itimer_count(self):
1255 # Some systems have poor setitimer() resolution (for example
1256 # measured around 20 ms. on FreeBSD 9), so decide on a reasonable
1257 # number of sequential timers based on that.
1258 reso = self.measure_itimer_resolution()
1259 if reso <= 1e-4:
1260 return 10000
1261 elif reso <= 1e-2:
1262 return 100
1263 else:
1264 self.skipTest("detected itimer resolution (%.3f s.) too high "
1265 "(> 10 ms.) on this platform (or system too busy)"
1266 % (reso,))
1267
1268 @unittest.skipUnless(hasattr(signal, "setitimer"),
1269 "test needs setitimer()")

Calls 2

skipTestMethod · 0.80

Tested by

no test coverage detected