This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %%%------------------------------------------------------------------- | |
| %%% @author [email protected] | |
| %%% @doc 一个简单的分层时间轮实现:类似于3维数组实现时钟 | |
| %%% 根据 http://www.embeddedlinux.org.cn/RTConforEmbSys/5107final/LiB0071.html 实现 | |
| %%% 1.时钟原理说明: | |
| %%% 1.1. 初始化一个三层时间轮:秒刻盘:0~59个SecList, 分刻盘:0~59个MinList, 时刻盘:0~12个HourList; | |
| %%% 1.2. SecTick由外界推动,每跳一轮(60格),SecTick复位至0,同时MinTick跳1格; | |
| %%% 1.3. 同理MinTick每跳一轮(60格),MinTick复位至0,同时HourTick跳1格; | |
| %%% 1.4. 最高层:HourTick跳一轮(12格),HourTick复位至0,一个时间轮完整周期完成. | |
| %%% 2.事件原理说明: |