Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can an object know of it's existence?
Message
De
02/12/2003 16:04:04
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00855003
Message ID:
00855185
Vues:
18
The time resolution of 'free-wheeling' SYS(2015) is 1 ms but the internal counter gets bumped on each call, so SYS(2015) runs ahead of system time if you call it more often than 1000 times per second for a length of time. But if the pace of calls slacks off then SYS(2015) waits for the system time to catch up, in a manner of speaking. ;-)

So, for all practical purposes names salted with SYS(2015) are guaranteed to be unique within a process because the SYS(2015) output is unique. A very useful function indeed ...

The format uses 6 base-36 digits for the millisecond count within one day so theoretically one could construct a situation where SYS(2015) fails by wrapping - but that would require 2,176,782,336 calls within a single day, i.e. at least 25 calls per millisecond on average for a whole day. I think SYS(2015) is more than fast enough to be called in that manner but if you actually use the output for something then the threat diminishes. ;-)

EDIT: the above statement is only 24/25th correct because I forgot to make allowance for the 'system-time-catchup' property of SYS(2015).

EDIT #2: I don't know whether SYS(2015) wraps on overflow or simply bumps the day count by one. I really should go for a smoke before I post an answer instead of afterwards. *g*
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform