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

Side by Side Diff: common.sh

Issue 3050047: fix print of total elapsed time (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: third time's a charm Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Common constants for build scripts 5 # Common constants for build scripts
6 # This must evaluate properly for both /bin/bash and /bin/sh 6 # This must evaluate properly for both /bin/bash and /bin/sh
7 7
8 # All scripts should die on error unless commands are specifically excepted 8 # All scripts should die on error unless commands are specifically excepted
9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'.
10 # TODO: Re-enable this once shflags is less prone to dying. 10 # TODO: Re-enable this once shflags is less prone to dying.
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 447
448 # Get current timestamp. Assumes common.sh runs at startup. 448 # Get current timestamp. Assumes common.sh runs at startup.
449 start_time=$(date +%s) 449 start_time=$(date +%s)
450 450
451 # Print time elsapsed since start_time. 451 # Print time elsapsed since start_time.
452 print_time_elapsed() { 452 print_time_elapsed() {
453 end_time=$(date +%s) 453 end_time=$(date +%s)
454 elapsed_seconds="$(( $end_time - $start_time ))" 454 elapsed_seconds="$(( $end_time - $start_time ))"
455 minutes="$(( $elapsed_seconds / 60 ))" 455 minutes="$(( $elapsed_seconds / 60 ))"
456 seconds="$(( $elapsed_seconds % 60 ))" 456 seconds="$(( $elapsed_seconds % 60 ))"
457 echo "Elapsed time: ${minutes}:${seconds}" 457 echo "Elapsed time: ${minutes}m${seconds}s"
458 } 458 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698