[Twisted-Python] Intended semantics of IReactorTime.seconds

Tristan Seligmann mithrandi at mithrandi.net
Sat Mar 26 14:33:35 MDT 2016


Currently, as far as I can tell, all implementations of
`IReactorTime.seconds()` (excluding twisted.internet.task.Clock, obviously)
are just `time.time()`; IOW, the return value is the number of seconds
since the beginning of the UNIX epoch in UTC. Are these the intended
semantics? The interface docstring doesn't really make this clear at all.

There's some commented out code which suggests the implementation used to
be `time.clock()` on win32, which would not satisfy these semantics.

(The background for this question is that I'm writing some code which takes
an IReactorTime provider for testing purposes, and I'm wondering if I need
a separate provider of `datetime.now()` functionality or not)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20160326/92f48817/attachment.html>


More information about the Twisted-Python mailing list