【问题标题】:What is std equivalent of boost cpu timer什么是std等价于boost cpu timer
【发布时间】:2018-04-09 14:35:10
【问题描述】:

我想将我的代码中的boost::timer::cpu_timer 迁移到标准库解决方案。我只找到了std::chrono::steady_clock,但它没有提供与 boost 变体相同的功能。我基本上需要的是墙和系统时间输出,例如

5.713010s wall, 5.709637s user + 0.000000s system = 5.709637s CPU (99.9%)

标准库中有这样的东西吗?

【问题讨论】:

    标签: c++ boost timer chrono


    【解决方案1】:

    不,C++ 标准库中没有任何东西可以测量系统和用户时间。您只能使用std::chrono:: 函数(其中steady_clock 最适合测量时间间隔)来获取挂墙时间。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-17
      • 2017-09-05
      • 2014-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-28
      相关资源
      最近更新 更多