#pragma UNROLL 4
被用来做循环展开,下面是一个实例:
#include "time.h"
#include
#include
#include
using namespace std;
int main()
{
clock_t start_time, end_time;
start_time = clock(); //获取开始执行时间
#pragma unroll 1000
for (int i = 0; i < 2147483640; i++)
{
i++;
}
end_time = clock(); //获取结束时间
double Times = (double)(end_time - start_time) / CLOCKS_PER_SEC;
printf("%f seconds\n", Times);
return 0;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)