擅长:python、mysql、java
<p>你试过使用<code>time</code>模块吗?(注意:您的<code>speed</code>将是<code>m/s</code>,前提是您输入的<code>distance</code>在{<cd5>}中)</p>
<pre><code>import time
print time.time()
start = input("Press enter to start: ")
starttime =time.time()
stop = input("Press enter to stop")
stoptime =time.time()
dist1 = 0
dist2 = input("enter dist2:")
time = stoptime-starttime
print(time)
distance = int(dist2) - dist1
print(distance)
speed = int(distance)/ time
print(speed)
</code></pre>