Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer resolution
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Timer resolution
Divers
Thread ID:
01292525
Message ID:
01292525
Vues:
64
I know this has been discussed many times before but I do not fully understand yet. I have read about timers and how inaccurate they are. It appears that if left alone they do have good resolution though. I downloaded cpptimer and ran the test. It reported a resolution of 20.7469ms on my system. So I adapted the included test code and ran it with a vfp timer. Then it reported a resolution of .9369ms. To me this says that the timer works pretty good at least if you do not interrupt it. Did I make an error in my code or understanding?
tt=CREATEOBJECT('timertest')
wait window "Counting, please DO NOT press a key!" timeout 5
?
?"Available resolution: ",5000/tt.tics,"ms  Timer tics:",tt.tics
?
RELEASE tt

DEFINE CLASS timertest as Timer

	interval=1
	tics=0
	
	PROCEDURE timer
		this.tics=this.tics+1
	ENDPROC

ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform