请大家帮一个忙。
    
    在Java中, 如何高效率的取得系统的时间,精确到毫秒?     在系统中产生不重复的流水号,所以取时间的这个函数会常被调用。     另外,大家有没有产生流水号的好方法,只要不重复就可以了,不要求是递增的。    谢谢。

解决方案 »

  1.   

    java.lang 
    Class System
    static long currentTimeMillis() 
              Returns the current time in milliseconds.
      

  2.   

    system's milliSecond:long curMilliSecond = System.currentTimeMillis();//milliseconds between now and 00:00 January 1, 1970 UTCor system's nanoSecond:long curNanoSecond = System.nanoTime();//the current value of the system timer, in nanosecondsor the hashCode of UDI:int UIDHashCode = (new java.rmi.server.UID()).hashCode();//the hash code value for this UID. notes:this method overrides the method java.lang.Object.hashCode();or just to use UID:String UIDString = (new java.rmi.server.UID()).toString();//a string representation of this UID