【问题标题】:How fast c++ file is fulfilled? [duplicate]完成 c++ 文件的速度有多快? [复制]
【发布时间】:2011-12-15 13:01:01
【问题描述】:

可能重复:
How to measure execution time of command in windows command line?

是否有计算 .exe 文件执行速度的程序?例如,如果我必须编写从输入文件中获取一个数字的 c++,将其乘以 2 并在输出文件中输出。如果我启动 c++ 程序,我不知道它完成的速度有多快,因为对我来说它看起来像 0.1 秒 - 闪烁的窗口。那么有没有机会准确地知道它的时间?

【问题讨论】:

    标签: c++


    【解决方案1】:

    在 Unix 上,time 命令会告诉您一个命令花费了多长时间,包括用户、系统和总时间。

    【讨论】:

      【解决方案2】:

      在 Linux 和其他 unice 下,您可以使用 time 命令。

      time foo.exe
      
      real    0m0.053s
      user    0m0.000s
      sys     0m0.000s
      

      我相信 Windows 也有一些等价物。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-07-30
        • 2011-12-15
        • 2018-07-04
        • 2016-03-12
        • 2010-10-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多