Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: tools/android/loading/common_util.py

Issue 2112013003: sandwich: Use cachetool's batch mode to speed-up cache processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@af00
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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))

Powered by Google App Engine
This is Rietveld 408576698