【CPP】常用功能:程序运行计时

C++ 常用功能:程序运行计时

#include <iostream>
#include <chrono>

int main()
{
    // 测试运行时间
    auto start = std::chrono::steady_clock::now();

    // Run code

    auto end = std::chrono::steady_clock::now();
    std::chrono::duration<double> elapsed_seconds = end - start;
    elapsed_seconds = end - start;
    std::cout << "ReRender time cc: " << elapsed_seconds.count() << "s" << std::endl;
}
posted @ 2025-01-16 14:26  ReRound  阅读(26)  评论(0)    收藏  举报