| OLD | NEW |
| (Empty) | |
| 1 # Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """ |
| 6 This script converts to %time% compatible strings passed to it into seconds, |
| 7 subtracts them, and prints the difference. That's it. It's used by timeit.bat. |
| 8 """ |
| 9 |
| 10 import re |
| 11 import sys |
| 12 |
| 13 def ParseTime(time_string): |
| 14 # Time looks like 15:19:30.32 |
| 15 match = re.match("(.*):(.*):(.*)\.(.*)", time_string) |
| 16 hours, minutes, seconds, fraction = map(int, match.groups()) |
| 17 return hours * 3600 + minutes * 60 + seconds + fraction * .01 |
| 18 |
| 19 print "%1.2f seconds elapsed time" % (ParseTime(sys.argv[1]) - |
| 20 ParseTime(sys.argv[2])) |
| OLD | NEW |