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}" |
+} |