All pastes #1749152 Raw Edit

C

public c v1 · immutable
#1749152 ·published 2010-01-13 02:50 UTC
rendered paste body
#include <stdio.h>#include <time.h>#include <string.h>#include <limits.h>int main(){	time_t start,end;	int something;	int i;	long long a,b;		a = 0x1122334455667788;	b = 0x1122334455667789;	time(&start);	for(i=0;i<INT_MAX;i++){		if(a>b){			a-=1;			b+=1;		}else {			a+=1;			b-=1;		}	}		time(&end);	printf("8byte int took - %lus\n",end-start);	char a_char[8],b_char[8];	char c;	strcpy(a_char,"1234567");	strcpy(b_char,"1234568");	time(&start);	for(i=0;i<INT_MAX;i++){		if(strcmp(a_char,b_char)>0){			a_char[7]-=1;			b_char[7]+=1;		}else {			a_char[7]+=1;			b_char[7]-=1;		}	}	time(&end);	printf("8b char took - %lus\n",end-start);	char aa_char[16],bb_char[16];	strcpy(aa_char,"123456781234567");		strcpy(bb_char,"123456781234568");		time(&start);	for(i=0;i<INT_MAX;i++){		if(strcmp(aa_char,bb_char)>0){			aa_char[15]-=1;			bb_char[15]+=1;		}else {			aa_char[15]+=1;			bb_char[15]-=1;		}	}	time(&end);	printf("16b char took - %lus\n",end-start);	return 0;}