Fastcounter

https://circleci.com/gh/jd/fastcounter.svg?style=svg Mergify Status

Fastcounter is an Apache 2.0 licensed fast counter library written in Python. It aims at implementing fast incremental integer with different trade-offs on performance depending on your use case.

It provides 3 classes:

  • Counter, a simple integer counter that does not support any concurrency.
  • FastWriteCounter, a counter that is thread-safe and is faster at writing than reading.
  • FastReadCounter, a counter that is thread-safe and is faster at reading than writing.

Example:

import fastcounter

counter = fastcounter.Counter()

counter.value # returns 1
counter.increment()
counter.value # returns 2
::...
免责声明:
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:

或是邮件反馈可也:
askdama[AT]googlegroups.com



自怼圈/年番新

DU21.4
关于 ~ DebugUself with DAMA ;-)


关注公众号, 持续获得相关各种嗯哼:
zoomquiet


粤ICP备18025058号-1
公安备案号: 44049002000656 ...::