summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-09-18 11:19:35 +0100
committerMichael Allen <michael@michaelallen.io>2015-09-18 11:19:35 +0100
commit549734abff2d7cae30b48453687d07212984735f (patch)
tree8d5ef312eede2ef6aa094bf352e68c18d44de1d5
parent1f6a8f84946a0cb6936916f47b5a3870fa12a5a6 (diff)
downloadgit-sonar-549734abff2d7cae30b48453687d07212984735f.tar.gz
git-sonar-549734abff2d7cae30b48453687d07212984735f.zip
timing function for performance testing
-rwxr-xr-xradar-base.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/radar-base.sh b/radar-base.sh
index d9cd8f5..92fa205 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -5,6 +5,14 @@ cwd=""
remote=""
rcfile_path="$HOME"
+timethis() {
+ cmd="$@"
+ start=$(gdate +%s.%N)
+ eval $cmd
+ dur=$(echo "$(gdate +%s.%N) - $start" | bc)
+ echo "$1 - $dur" >> $HOME/duration.dat
+}
+
prepare_bash_colors() {
if [ -f "$rcfile_path/.gitradarrc.bash" ]; then
source "$rcfile_path/.gitradarrc.bash"