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

Side by Side Diff: build/android/pylib/utils/time_profile.py

Issue 2101243005: Add a snapshot of flutter/engine/src/build to our sdk (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add README.dart 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
(Empty)
1 # Copyright (c) 2013 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 import logging
6 import time
7
8
9 class TimeProfile(object):
10 """Class for simple profiling of action, with logging of cost."""
11
12 def __init__(self, description):
13 self._starttime = None
14 self._description = description
15 self.Start()
16
17 def Start(self):
18 self._starttime = time.time()
19
20 def Stop(self):
21 """Stop profiling and dump a log."""
22 if self._starttime:
23 stoptime = time.time()
24 logging.info('%fsec to perform %s',
25 stoptime - self._starttime, self._description)
26 self._starttime = None
OLDNEW
« no previous file with comments | « build/android/pylib/utils/test_environment.py ('k') | build/android/pylib/utils/timeout_retry.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698