Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

timer

> 编程语言
Open source

C++ 定时器, 基于 C++11, libuv 实现

100 stars0 likes2 views
WebsiteGitHub

About

C++ 定时器, 基于 C++11, libuv 实现

Versioning

This project follows the semantic versioning scheme. The API change and backwards compatibility rules are those indicated by SemVer.

是什么

C++ 定时器, 基于 C++11, libuv 实现.

TimerManager 在 Start() 时会创建 thread_num 个工作线程, 每一个工作线程中都运行着一个 uv loop.

当通过 TimerManager::StartTimer() 提交一个定时器时, 会通过 round-robin 算法选择一个工作线程(下称 P), 然 后将定时器请求交给 P. P 在收到定时器请求之后会根据请求细节创建一个 uv_timer_t 对象来实现定时机制.

怎么用

test/main.cc 中有一个很简短的例子, 可以参考. 关于接口具体的语义可以参考每一个接口的注释.

依赖

  1. C++11
  2. libuv, v1.9.1
  3. common, v1.1.0

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言