【发布时间】:2020-08-22 06:28:32
【问题描述】:
我在 Windows 10 上使用 g++ 8.1.0 版,但当我尝试编译时仍然
auto start=high_resolution_clock::now();
rd(n);
auto stop=high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop-start);
cout<<duration.count()<<endl;
我得到的错误是
error: 'high_resolution_clock' has not been declared
auto start=high_resolution_clock::now();
^~~~~~~~~~~~~~~~~~~~~
我已经包含了 chrono 和 time.h
【问题讨论】:
-
high_resolution_clock-->std::chrono::high_resolution_clock
标签: c++ time chrono high-resolution-clock