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 从互联网中抓取并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:

蟒营®编程思维提高班 Python版/第11期 正在报名

精品小班/ 每期<42人

扫描报名: 101camp11py

蟒营®式 原创课程

伴你重享学习乐趣

官网: py.101.camp

Reactivate Joy by Self-teching with You


任何问题可先进入知识星球(免费)咨询:
FAQ

关注公众号, 持续获得相关各种咨询:
mainium


追问

任何问题, 随时邮件提问可也:
askdama@googlegroups.com


...::