boostorg / boostorg/fiber

Can I adjust the accuracy of timer?

未关闭
#295 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
510
派生
123
PR 合并指标
30 天内没有已合并 PR

描述

Failed to achieve FPS 60 ( frame per second) :
```
auto timenow() {
return std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();
}

int main() {
boost::fibers::fiber mainFiber([]()
{
while (true) {
auto now = timenow();
boost::this_fiber::sleep_for(std::chrono::milliseconds(16));
std::cout << timenow() - now << "\n";
}
});
mainFiber.join();
}
```

Outputs ( should be 16 ):

```
34
27
30
31
31
31
30
31
30
29
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。