[Twisted-Python] Scalability of timers

Itamar Turner-Trauring itamar at itamarst.org
Sun Aug 10 17:26:41 MDT 2014


On 08/10/2014 06:23 PM, Tobias Oberstein wrote:
> I want to trade less precision (timers fire at less exact times) for 
> higher efficiency (less context switches).

It's easy enough to write one yourself. This might work:

    from twisted.internet.task import Clock, LoopingCall

    clock = Clock()
    LoopingCall(lambda: clock.advance(0.001)).start(0.001)

Now just do "clock.callLater" instead of "reactor.callLater".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20140810/c29d3a7e/attachment-0002.html>


More information about the Twisted-Python mailing list