摘要: 新版的GCC编译器都支持OpenMP。在程序中需要引入omp.h头文件,另外在编译时需要指定-fopenmp选项。#include<stdio.h>#include<omp.h>#include<time.h>void test(){ int a=0; clock_t t1=clock(); for(int i=0;i<10000000;i++){ a=i+1; } clock_t t2=clock(); printf("Test Time=%ld\n",t2-t1);}int main(int argc,char *argv[]) 阅读全文
posted @ 2011-10-31 16:37 张朝阳 阅读(8499) 评论(0) 推荐(0) 编辑