Chromium Code Reviews| Index: tools/android/loading/common_util.py |
| diff --git a/tools/android/loading/common_util.py b/tools/android/loading/common_util.py |
| index 899062cb29f7f38e4f1b6ea57fa789c7ae754efd..3b52a21f1fb21639d136263e69fa0ebb08838ed4 100644 |
| --- a/tools/android/loading/common_util.py |
| +++ b/tools/android/loading/common_util.py |
| @@ -148,3 +148,11 @@ def TimeoutScope(seconds, error_name): |
| if signal.getsignal(signal.SIGALRM) != _signal_callback: |
| raise TimeoutCollisionError('Looks like there is a signal.signal(signal.' |
| 'SIGALRM) made within the with statement.') |
| + |
| + |
| +@contextlib.contextmanager |
| +def TimeMeasurement(measurement_name): |
|
mattcary
2016/07/01 12:09:29
If this isn't used in this patch, make a separate
gabadie
2016/07/01 14:10:26
Done.
|
| + start = time.time() |
| + yield |
| + end = time.time() |
| + logging.info('%s: %ds', measurement_name, (end - start)) |