Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shorter than sys(2015)
Message
De
06/02/2015 07:57:09
 
 
À
06/02/2015 05:30:50
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
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:
01614959
Vues:
56
>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....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform