标签:data 直接 cas auto 代码 gis ble code mes
调用了c++11加入的chrono库和命名空间
直接贴代码
大部分内容来自这篇##blog##
好难背啊
#include<cstdio>
#include<chrono>
#include<cstdlib>//用万能头也行
using namespace std;
using namespace chrono;
int main()
{
register int i=1;
for(;;++i)
{
system("data.exe > in.txt");
auto s=system_clock::now();
system("std.exe < in.txt > stdout.txt");
auto t=system_clock::now();
system("test.exe < in.txt > testout.txt");
auto t2=system_clock::now();
auto duration1=duration_cast<microseconds>(t-s);
auto duration2=duration_cast<microseconds>(t2-t);
double time1=(double)(duration1.count())/1000;
double time2=(double)(duration2.count())/1000;
if(system("fc /W stdout.txt testout.txt > nul"))
{
printf("point #%d\nWA time used: std %.3fms test %.3lfms\n",i,time1,time2);
break;
}
else printf("point #%d\nAC time used: std %.3fms test %.3lfms\n",i,time1,time2);
}
system("pause>nul");
return 0;
}
标签:data 直接 cas auto 代码 gis ble code mes
原文地址:https://www.cnblogs.com/123789456ye/p/11046175.html