[ixp1200] ix_time_real() problems

Yan Luo yluo at cs.ucr.edu
Mon Feb 17 18:40:50 EST 2003


Hi,

In our IXP project, we want to calculate the time spent in a particular
program segment on StrongARM. The program is written in C++.
What we did is using ix_time library like this:
ix_error myfunction(...)
{
	ix_time   t1, t2, t3;
	int sec, nsec;

	ECK( ix_time_real(&t1)) ;

	/* some code here */

	ECK( ix_time_real(&t2));
	ECK( ix_time_sub(&t3, &t2, &t1));

	ECK( ix_time_get(&t3, &sec, &nsec));
	printf("sec=%d, nsec=%d", sec, nsec);
}

However, the nsec printed out sometimes has negative value.

Is it a bug in ix_time library or is the way we use ix_time library wrong?

Thanks
Yan
--
Yan Luo
Dept. of CSE, Univ. of California
Riverside, CA 92507, USA
http://www.cs.ucr.edu/~yluo/




More information about the ixp1200 mailing list