📜  时间测量 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:46.005000             🧑  作者: Mango

代码示例2
//***C++11 Style:***
#include 

std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();

std::cout << "Time difference = " << std::chrono::duration_cast(end - begin).count() << "[µs]" << std::endl;
std::cout << "Time difference = " << std::chrono::duration_cast (end - begin).count() << "[ns]" << std::endl;