使用C+提供以纳米秒为单位的时间的计时器功能
#include <ctime> #include <cstdio> using namespace std; int main(int argc, char** argv) { clock_t start; double diff; start = clock(); diff = ( std::clock() - start ) / (double)CLOCKS_PER_SEC; cout<<"printf: "<< diff <<'\n'; return 0; }
慕尼黑5688855
慕沐林林