Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time per mile
Message
From
22/04/1999 08:51:42
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00210880
Message ID:
00210954
Views:
21
>>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)

Too early in the morning, and overly complicated. The line above should be:

nTimePerMileInSecs = nNumSecsElapsed/nDistInMiles

>? 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
Previous
Reply
Map
View

Click here to load this message in the networking platform