Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shorter than sys(2015)
Message
De
06/02/2015 08:52:38
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
06/02/2015 07:57:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01614860
Message ID:
01614964
Vues:
59
>>I've tested like
>>
>>FOR ln1 = 1 TO 10
>> ?SYS(2015),seconds()
>>ENDFOR &&ln1 
>>
>>
>>I see two hits per milisecond, with increasing sys(2015)
>>Since there are two per milisecond there must be two within the same millisecond, even considering rounding. (I'm not sure if there is something that counts smaller then a millisecond, so the result shown could be rounded)
>
>There isQueryPerformanceCounter, and this one counts. But you have to keep QueryPerformanceFrequency in mind to get at the ms...
>
>>Now the only problem remaining is that this valid ony on a single thread :) Multiple threads still can create the same return value.
>>
>>Simple program
>>create table
>>
>>CREATE TABLE murks (c1 c(10))
>>use
>>
>>and a prog snippet
>>
>>USE murks SHARED again
>>FOR ln1 = 1 TO 100000
>> INSERT INTO murks VALUES SYS(2015)
>>ENDFOR &&ln1 
>>Simultaneously run this snippet on two instances of VFP on the same comp.
>>This gives 200000 records
>>
>>now test
>>
>>SELECT COUNT(*) as ncnt, c1 FROM murks GROUP BY 2 HAVING ncnt>1
>>
>>
>>I come up with 32787 hits ... 16%
>
>Guessing that on a single 1 core CPU the single comp would show no duplicates. To lazy to test by setting which core to run on....

1 core? This is realy called a computer? Just kidding. But my cell as more power then this .... :)
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform