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

Unified Diff: common.sh

Issue 2859005: Add Build Timer (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: space Created 10 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
« no previous file with comments | « build_image ('k') | mod_image_for_test.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common.sh
diff --git a/common.sh b/common.sh
index 395310b43c78e775b05e0ce7bf88db440d1868fa..6d7a7f9173d6727dc4af34f3fb417a805b25e4aa 100644
--- a/common.sh
+++ b/common.sh
@@ -429,3 +429,15 @@ setup_symlinks_on_root() {
sudo ln -s "${var_target}" "${dev_image_root}/var"
}
+
+# Get current timestamp. Assumes common.sh runs at startup.
+start_time=$(date +%s)
+
+# Print time elsapsed since start_time.
+print_time_elapsed() {
+ end_time=$(date +%s)
+ elapsed_seconds="$(( $end_time - $start_time ))"
+ minutes="$(( $elapsed_seconds / 60 ))"
+ seconds="$(( $elapsed_seconds % 60 ))"
+ echo "Elapsed time: ${minutes}:${seconds}"
+}
« no previous file with comments | « build_image ('k') | mod_image_for_test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698