gpt4 book ai didi

c# - 哪个更适合获得准确的性能计数 :DateTime or Stopwatch?

转载 作者:行者123 更新时间:2023-11-30 18:59:58 26 4
gpt4 key购买 nike

我知道 DateTime 和 Stopwatch 类,但我有点困惑。我只是想知道哪个更好,为什么?

最佳答案

Stopwatch 类使用适合执行(某些)基准测试的高分辨率计时器。顾名思义,它测量耗时(即模仿现实生活中的秒表。)

DateTime 适用于跟踪 *date*s 和 *time*s;不要将其用于基准测试。

关于c# - 哪个更适合获得准确的性能计数 :DateTime or Stopwatch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6551545/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com