From 549734abff2d7cae30b48453687d07212984735f Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Fri, 18 Sep 2015 11:19:35 +0100 Subject: timing function for performance testing --- radar-base.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'radar-base.sh') 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" -- cgit v1.2.3