Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sleep(1) too slow
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00916333
Message ID:
00916576
Vues:
9
> I didn't have a problem on my machine with resolution - it supported 1ms
> for both calls (you can test this by taking the average over a number of
> iterations). I think the overhead you were seeing is your Visual FoxPro
> code, not a limitation with the DLL calls. In that case (as you've found),
> Fabio's solution is probably the best for you.
> -Paul

Paul, try this and let me know what you get. Then change to sleep(0).

I wonder if the resolution of sleep depends on the OS I am using Win2k.


DECLARE Sleep IN WIN32API INTEGER nMillisecs

t1=SECONDS()
nItems=1000
FOR k=1 TO nItems
Sleep(1)
NEXT
? 1000*(SECONDS()-t1)/nItems,"ms"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform