[..]
> If all you want is relative time, the system clock is fine, even if it
> is inaccurate.
>
> If all you want is a sequence number for objects, use static seq++
> which will be faster by far than the clock.
[..]
> Perhaps if I knew what you were trying to accomplish I could direct
> you better.
relative time is all i want. life forms are born and die, each life
form'll have a life span (in miliseconds, presumably). when their age
>= life span, or for other reason, then that life form'll die.
i don't like the idea of a system clock because i might be serializing
the life forms for storage, and that'd involve more arithmetic than a
simple timer that only counts "up" while the life form exists -- like
a stopwatch.
thanks,
javac@mail.com
http://www.geocities.com/cjavacjava/
Roedy Green - 07 May 2004 00:30 GMT
>relative time is all i want.
For you own objects you can just use a sequence number you increment
any time you allocate something. To make it easier, you might have
private static int sequence = 0; per class.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.