OSDN Git Service

envsetup: add mk_timer
authorAnthony King <anthonydking@slimroms.net>
Thu, 30 Apr 2015 21:19:48 +0000 (22:19 +0100)
committerMichael Bestas <mikeioannina@gmail.com>
Fri, 6 Jan 2017 23:37:30 +0000 (01:37 +0200)
this wraps around any method call, mainly for 'make'.

mka needs this on linux, since ionice and schedtool don't
respect functions

Change-Id: If8cdd235ed9eba377dd90ab8b12e93036a377ea5

envsetup.sh

index a5b58d3..9f1b4c6 100644 (file)
@@ -1581,10 +1581,10 @@ function get_make_command()
   echo command make
 }
 
-function make()
+function mk_timer()
 {
     local start_time=$(date +"%s")
-    $(get_make_command) "$@"
+    $@
     local ret=$?
     local end_time=$(date +"%s")
     local tdiff=$(($end_time-$start_time))
@@ -1648,6 +1648,11 @@ function provision()
     "$ANDROID_PRODUCT_OUT/provision-device" "$@"
 }
 
+function make()
+{
+    mk_timer $(get_make_command) "$@"
+}
+
 if [ "x$SHELL" != "x/bin/bash" ]; then
     case `ps -o command -p $$` in
         *bash*)