Skip to content

Commit

Permalink
💚 improve output of duration in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
jxn-30 committed Jan 18, 2025
1 parent f2477e7 commit 078934e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ now () {
ms_elapsed () {
local timestamp_now
timestamp_now=$(now)
echo $(((10#$timestamp_now - 10#$1) / 1000000))ms
elapsed=$(((10#$timestamp_now - 10#$1) / 1000000))
seconds=$((elapsed / 1000))
ms=$(printf "%03d" $((elapsed - (seconds * 1000))))
minutes=$(printf "%02d" $((seconds / 60)))
seconds=$(printf "%02d" $((seconds - (minutes * 60))))
echo "${minutes}:${seconds}.${ms} (${elapsed}ms)"
}

print_start_message () {
Expand Down
7 changes: 6 additions & 1 deletion scripts/createBuildScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ fi`,
`ms_elapsed () {
local timestamp_now
timestamp_now=$(now)
echo $(((10#$timestamp_now - 10#$1) / 1000000))ms
elapsed=$(((10#$timestamp_now - 10#$1) / 1000000))
seconds=$((elapsed / 1000))
ms=$(printf "%03d" $((elapsed - (seconds * 1000))))
minutes=$(printf "%02d" $((seconds / 60)))
seconds=$(printf "%02d" $((seconds - (minutes * 60))))
echo "\${minutes}:\${seconds}.\${ms} (\${elapsed}ms)"
}`,
`print_start_message () {
echo "\${bold}$\{blue}### $1 ###$\{normal}"
Expand Down

0 comments on commit 078934e

Please sign in to comment.