std::chrono计算程序运行时间 voidCalRunTime() { auto t1=std::chrono::steady_clock::now();//run codeauto t2=std::chrono::steady_clock::now();//秒doubledr_s=std::chrono::duration<double>(t2-t1).count();//毫秒级doubledr_ms=std::chrono::duration<double,std::milli>(t2-t1).count();...
auto beforeTime = std::chrono::steady_clock::now(); Run(); auto afterTime = std::chrono::steady_clock::now(); std::cout << "总耗时:" << std::endl; //秒 double duration_second = std::chrono::duration<double>(afterTime - beforeTime).count(); std::cout << duration_second <<...