Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Creating unique ID's?

From: joel:neely:fedex at: 16-Jul-2002 14:35

Hi, Gregg, Gregg Irwin wrote:
> << > I need to create ID's which are unique over even when they are created > on different machines, or several poeple on the same machine, etc. Does > anyone have a better idea than > > unique-id: join join system/user/email system/network/host now/precise > >> > > I guess that depends on *how* unique they need to be. For example, if you > call this twice in a row, you'll very likely get the same ID... >
It depends on your computer!!! On a real computer/OS with a microsecond clock, even consecutive evaluations of NOW/TIME/PRECISE yield different values...
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:25.950478 14:42:25.950988 14:42:25.951521]
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:30.728039 14:42:30.728536 14:42:30.729006]
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:31.277009 14:42:31.277474 14:42:31.27795]
>> reduce [now/time/precise now/time/precise now/time/precise]
== [14:42:31.743064 14:42:31.743529 14:42:31.744091] ... although that doesn't hold true for Visual MS-DOS. ;-) -jn-