Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does time run backwards?
Message
From
19/03/2001 15:24:38
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Does time run backwards?
Miscellaneous
Thread ID:
00486596
Message ID:
00486596
Views:
41
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
Next
Reply
Map
View

Click here to load this message in the networking platform