[英]How should i measure execution time of a C++ program when I execute it from Java code?
[英]How to measure the execution time of my whole program in c++
拜托,我需要找到用 C++ 編寫的程序的執行時間,而不是我的部分代碼的執行時間。 我需要整個代碼的執行時間
獲取啟動每個代碼時的時間點
#include <chrono>
using namespace std::chrono;
// Use auto keyword to avoid typing long
// type definitions to get the timepoint
// at this instant use function now()
auto start = high_resolution_clock::now();
然后得到結束時間點
#include <chrono>
using namespace std::chrono;
// After function call
auto stop = high_resolution_clock::now();
然后取不同的start-stop
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.