Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time per mile
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00210880
Message ID:
00210946
Vues:
22
>Hi all,
>
>Real basic formula needed for calculating a time per mile.
>
>For instance, if I ran 10.5 miles in 1hr 10min and 15 seconds, what is the proper way to calculate the per mile time? I have come up with a simple calculation but It's not always reporting the correct minute/secs per mile.
>

I'd convert to seconds, compute in seconds, and convert back.

nNumSecsElapsed = (3600 * nNumHrs) + (60 * nNumMins) + nNumSecs
#DEFINE SECSPERHR 3600 && 60 * 60
nTimePerMileInSecs = (nNumSecsElapsed /(nDistInMiles * SECSPERHR)
? TTOC({^1999-01-01 0:0} + nTimePerMileInSecs,2)

>Any ideas?
>
>Thanks.
>
>John.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform