[ZODB-Dev] Scalable Container for Log-Entries

Tim Peters tim at zope.com
Wed Jan 28 12:05:24 EST 2004


[Thomas Guettler]
> It seems to be OK. I am running this script since
> several minutes:
>
> frac=1000000
> while 1:
>     now=time.time()
>     now2=time.time()
>     now=long(now*frac)
>     now2=long(now2*frac)
>     if now==now2:
>         raise("Equal: %s" % now)

While there are no guarantees, Python's time.time() typically updates a
million times per second on Linux, 18.2 times per second on Windows, and 1
time per second on Mac Classic.  Especially on Linux, you may also need to
be prepared for "time running backwards"; e.g., if the box is hooked up to a
net time service and corrects for drift now and again.  time.time() *can* be
completely baffling on multiprocessor boxes too, depending on all sorts of
obscure OS and C library details (the problem is that, depending on how the
platform C implements its notion of time, each processor may end up with its
view of current time, they can get out of synch, and then the time.time()
result depends on which processor happened to execute it).




More information about the ZODB-Dev mailing list