Newsgroups: comp.sys.transputer
From: prreali@iiic.ethz.ch (Patrik Rene Celeste Reali)
Subject: Time
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: 28 Apr 1994 14:35:03 GMT
Message-ID: <2pohin$l1t@neptune.inf.ethz.ch>

I was measuring how long does a FOR take on a T800,
 but the results are very strange to me!
Perhaps I made some mistake. Could you help me? (PLEASE)

My program:


#include <conc.h>
#include <stdio.h>

int i,t1,t2,t3;

main() {
	SetTime(0); for(i=0;i<MAX;i++) ;
	t1=Time();

	SetTime(0); for(i=0;i<MAX;i++) ;
	t2=Time();
	
	SetTime(0); for(i=0;i<MAX;i++) ;	
	t3=Time();

	printf("1. time %i\n",t1);
	printf("2. time %i\n",t2);
	printf("3. time %i\n",t3);
}

My results:
with MAX=10000
1. time 310
2. time 310
3. time 310

with MAX=100000
1. time 2972
2. time 3105
3. time 3215

with MAX=1000000
1. time 29726
2. time 31042
3. time 32159

I don't understand why the first time is *always* less than the others times!

Any help is welcome! THANKS 

Patrik Reali, prreali@iiic.ethz.ch


