aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/build_commands.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-25 21:31:48 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-25 21:31:48 -0500
commit345b8b9c00b146259b2b665775c3a5aa7ded6056 (patch)
treed75d1d349b898524b9596f9ee0a79c1bdab2bfdc /python/servo/build_commands.py
parent73b4042bb348d018e13798c39c6c4c3b117c1791 (diff)
parent799490d92085106fc41a59a8fe062f1b98b8ab89 (diff)
downloadservo-345b8b9c00b146259b2b665775c3a5aa7ded6056.tar.gz
servo-345b8b9c00b146259b2b665775c3a5aa7ded6056.zip
Auto merge of #11374 - servo:no-microseconds, r=Ms2ger
Don’t include microsecons when reporting build times. "0:03:40.817715" is harder to read and no more informative than "0:03:40" <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11374) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r--python/servo/build_commands.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 32989c86ad8..d10be83e0a7 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -26,6 +26,10 @@ from mach.decorators import (
from servo.command_base import CommandBase, cd, call, BIN_SUFFIX
+def format_duration(seconds):
+ return str(datetime.timedelta(seconds=int(seconds)))
+
+
def notify_linux(title, text):
try:
import dbus
@@ -86,7 +90,7 @@ def notify_build_done(elapsed):
"""Generate desktop notification when build is complete and the
elapsed build time was longer than 30 seconds."""
if elapsed > 30:
- notify("Servo build", "Completed in %s" % str(datetime.timedelta(seconds=elapsed)))
+ notify("Servo build", "Completed in %s" % format_duration(elapsed))
def notify(title, text):
@@ -240,7 +244,7 @@ class MachCommands(CommandBase):
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
- print("Build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
+ print("Build completed in %s" % format_duration(elapsed))
return status
@Command('build-cef',
@@ -276,7 +280,7 @@ class MachCommands(CommandBase):
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
- print("CEF build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
+ print("CEF build completed in %s" % format_duration(elapsed))
return ret
@@ -313,7 +317,7 @@ class MachCommands(CommandBase):
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
- print("GeckoLib build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
+ print("GeckoLib build completed in %s" % format_duration(elapsed))
return ret
@@ -351,7 +355,7 @@ class MachCommands(CommandBase):
# Generate Desktop Notification if elapsed-time > some threshold value
notify_build_done(elapsed)
- print("Gonk build completed in %s" % str(datetime.timedelta(seconds=elapsed)))
+ print("Gonk build completed in %s" % format_duration(elapsed))
return ret