...
 
Commits (1)
......@@ -113,24 +113,6 @@ unsigned char BYTE = 0;
int main()
{
unsigned long t1,t2;
int i,n = 100000000;
t1 = clock();
for(i=0;i<n;i++)
{
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
}
t2 = clock();
System *sys = System::getInstance();
World world;
......@@ -191,9 +173,28 @@ int main()
iC = at("COUT");
NAMED(ha7);
unsigned long t1,t2;
int i,n = 100000000;
t1 = clock();
for(i=0;i<n;i++)
{
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
BYTE++;
}
t2 = clock();
printf("BYTE=0x%2.2X (%6.6fs or %2.2fns per increment)\n",BYTE,
(double)(t2-t1)/CLOCKS_PER_SEC,
(double)(t2-t1)/(n/1e8)/CLOCKS_PER_SEC
/* 1e8 because we have 10 increments per iteration */
);
n = 0x100000;
......@@ -217,6 +218,4 @@ int main()
(double)(t2-t1)/CLOCKS_PER_SEC,
(double)(t2-t1)/(n/1e9)/CLOCKS_PER_SEC
);
}