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

Side by Side Diff: infra/bots/utils.py

Issue 1769583002: Swarming tasks: print start and end time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unused import Created 4 years, 9 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
« no previous file with comments | « infra/bots/test_skia.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2016 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8
9 import datetime
10
11
12 class print_timings(object):
13 def __init__(self):
14 self._start = None
15
16 def __enter__(self):
17 self._start = datetime.datetime.utcnow()
18 print 'Task started at %s GMT' % str(self._start)
19
20 def __exit__(self, t, v, tb):
21 finish = datetime.datetime.utcnow()
22 duration = (finish-self._start).total_seconds()
23 print 'Task finished at %s GMT (%f seconds)' % (str(finish), duration)
OLDNEW
« no previous file with comments | « infra/bots/test_skia.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698