Add timeit.bat to tools\win

timeit.bat is a simple batch file that times whatever command you pass
to it. It uses a helper python script to do the math at the end. There
is no error checking so don't make mistakes.

R=dcheng@chromium.org

Review-Url: https://codereview.chromium.org/2820843002
Cr-Original-Commit-Position: refs/heads/master@{#464815}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8811aed463ee87b0302ff8a80a730ebd86dee515
diff --git a/subtract_time.py b/subtract_time.py
new file mode 100644
index 0000000..4e1559b
--- /dev/null
+++ b/subtract_time.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+This script converts to %time% compatible strings passed to it into seconds,
+subtracts them, and prints the difference. That's it. It's used by timeit.bat.
+"""
+
+import re
+import sys
+
+def ParseTime(time_string):
+  # Time looks like 15:19:30.32
+  match = re.match("(.*):(.*):(.*)\.(.*)", time_string)
+  hours, minutes, seconds, fraction = map(int, match.groups())
+  return hours * 3600 + minutes * 60 + seconds + fraction * .01
+
+print "%1.2f seconds elapsed time" % (ParseTime(sys.argv[1]) -
+                                      ParseTime(sys.argv[2]))
diff --git a/timeit.bat b/timeit.bat
new file mode 100755
index 0000000..af00372
--- /dev/null
+++ b/timeit.bat
@@ -0,0 +1,13 @@
+@ECHO off
+
+REM Copyright (c) 2017 The Chromium Authors. All rights reserved.
+REM Use of this source code is governed by a BSD-style license that can be
+REM found in the LICENSE file.
+
+REM This batch file executes the commands passed to it and prints out the
+REM elapsed run time.
+
+SETLOCAL
+SET starttime=%time%
+CALL %*
+CALL python %~dp0subtract_time.py %time% %starttime%