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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import shutil 10 import shutil
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 signal.signal(signal.SIGALRM, _signal_callback) 141 signal.signal(signal.SIGALRM, _signal_callback)
142 if signal.alarm(seconds) != 0: 142 if signal.alarm(seconds) != 0:
143 raise TimeoutCollisionError( 143 raise TimeoutCollisionError(
144 'Discarding an alarm that was scheduled before.') 144 'Discarding an alarm that was scheduled before.')
145 yield 145 yield
146 finally: 146 finally:
147 signal.alarm(0) 147 signal.alarm(0)
148 if signal.getsignal(signal.SIGALRM) != _signal_callback: 148 if signal.getsignal(signal.SIGALRM) != _signal_callback:
149 raise TimeoutCollisionError('Looks like there is a signal.signal(signal.' 149 raise TimeoutCollisionError('Looks like there is a signal.signal(signal.'
150 'SIGALRM) made within the with statement.') 150 'SIGALRM) made within the with statement.')
151
152
153 @contextlib.contextmanager
154 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.
155 start = time.time()
156 yield
157 end = time.time()
158 logging.info('%s: %ds', measurement_name, (end - start))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698