Skip to content

Instantly share code, notes, and snippets.

@nitrix
Created October 18, 2012 07:32
Show Gist options
  • Save nitrix/3910296 to your computer and use it in GitHub Desktop.
Save nitrix/3910296 to your computer and use it in GitHub Desktop.
unsigned int z = 1023;
unsigned int x = 1024;
unsigned int test,i;
/* test A */
double a = get_time();
for(i=0; i<1000000000; i++) {
test = 99999;
test &= z;
}
printf("A: %f\n",get_time()-a);
/* test B */
double b = get_time();
for(i=0; i<1000000000; i++) {
test = 99999;
test %= x;
}
printf("B: %f\n",get_time()-b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment