I am using g++ version 8.1.0 on windows 10 but still when I try to compile
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;
I get the error as
error: 'high_resolution_clock' has not been declared
auto start=high_resolution_clock::now();
^~~~~~~~~~~~~~~~~~~~~
I have included both chrono and time.h
You need to specify the
std::chrono::namespace qualifier in front ofhigh_resolution_clock,microseconds, andduration_cast, eg:Otherwise, you can use
usingstatements instead, eg:or: