#pragma UNROLL 4
被用来做循环展开,下面是一个实例:
#include "time.h"
#include <stdio.h>
#include<iostream>
#include<Windows.h>
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;
}