Skip to content

Instantly share code, notes, and snippets.

@jotaki
Last active December 18, 2015 23:49
Show Gist options
  • Save jotaki/5864523 to your computer and use it in GitHub Desktop.
Save jotaki/5864523 to your computer and use it in GitHub Desktop.
#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