Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does time run backwards?
Message
De
19/03/2001 15:24:38
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Does time run backwards?
Divers
Thread ID:
00486596
Message ID:
00486596
Vues:
40
I recently spent several frustrating hours debugging a problem which had arisen on our home grown proxy server where requests were instantaneously timing out. The cause of the problem was that successive calls to SECO() in FP26DOS returned values which in some cases were smaller than previous ones. The differences were small (less than .05 seconds) but I just can't figure out how FoxPro apparently thinks that time runs backwards!
To prove to myself and my colleagues that I wasn't hallucinating I recreated a simple test program:
clear 
for j=1 to 100
   ts=seco()
   do while .t.
      mtimenow=seco()
      if mtimenow>ts+3
         *3 seconds - no response - time out
         mpsreturn='timeout'
         exit
      endif
      if mtimenow mpsreturn='SECO() time error'
         ? mpsreturn,ts,mtimenow
         exit
      endif
   enddo
endfor
The results show that the behaviour is consistent - at least on my machine and several others here.

Has anyone else experienced this?
BTW the fix in the end was simple (if not elegant): I introduced a half second wait between the first call to SECO() and the second - which is really weird because now to detect a time out I have to slow things down!!!
Sam Robbins BCRTC
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform