Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Compute Hours, Minutes, Seconds from SECONDS()
Message
De
03/09/1999 17:59:26
 
 
À
03/09/1999 17:49:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00261364
Message ID:
00261418
Vues:
23
>>>Anybody have a technique for measuring the amount of time it takes a function to process?
>>>
>>>I tried the following ... but that give me total seconds and I need the that result converted to hours:minutes:seconds.
>>>
>>>Other Suggestions? Ideas?
>>>
>>>nStart = Seconds()
>>>.
>>>(my code)
>>>.
>>>
>>>nStop = Seconds()
>>>
>>>nRunTime = nStop-nStart
>>>
>>>How to get nRunTime to look like HH:MM:SS??
>>>
>>>Help?
>>>
>>>Please and thanks.
>>
>>
>>? TTOC(DTOT(DATE())+nRunTime,2)
>
>Interesting- but only good for values > 1 hour and less than 24...

What do you mean "> 1 hour"? It works with seconds. And you're correct it is only good for up 23:59:59. :) If you want to show days, that's another animal, but it can be done:
dBase = DATE()                  && How's that for a variable name! ;)
tEnd = DTOT(dBase) + 87036      && Some elapsed time more than 1 day
?'Days:',TTOD(tEnd)-dBase,TTOC(tEnd,2)
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform