Note that Java represents time with millisecond _resolution_ which is not
at all the same thing as millisecond _accuracy_ in the real world.

Relying upon this sort of thing has the effect of introducing a platform
dependency which could make the whole design fall over.  For example, on
the IBM System/390 mainframe, real world accuracy is limited to one full
second, so millisecond resolution just sees the seconds incrementing
0.000, 1.000, 2.000, and so on.

-- Mike


On 2001-06-26 at 15:57 -0400, Jim Kimball wrote:

> If you are looking for a simple unique ID generator that is also (somewhat)
> evenly distributed, use a reverse timestamp. Use
> System.getCurrentTimeMillis(), turn it into a string, then reverse it.
> 
> If you have performance problems with such a simple algorithm, you might
> want to write your own routine to do the reversing of a long without using
> the generic String methods.
> 
> Jim


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to