Last active
December 18, 2015 23:49
-
-
Save jotaki/5864523 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <time.h> | |
#include <omp.h> | |
int main() | |
{ | |
unsigned long long l = 0, a = 0; | |
clock_t start, stop; | |
start = clock(); | |
#pragma omp parallel for private(l, a) | |
for(l = 0; l < 0x3b9aca00ULL; ++l) a += l; | |
stop = clock(); | |
printf("%ld ms\n", (long)(stop - start) * 1000 / CLOCKS_PER_SEC); | |
printf("a = 0x%0llx, l = 0x%0llx\n", a, l); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment