aboutsummaryrefslogtreecommitdiff
path: root/func.go
diff options
context:
space:
mode:
authorFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-05-08 00:23:10 +0900
committerFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-05-08 00:23:10 +0900
commit586b02a82282ac55f354a0b021ca695a8b3bf028 (patch)
treefd652b12b72304ed8cc7c58d4641e46f2e231f3f /func.go
parent4107b20d1221f1d868c2b47828a4ea825b11e4a9 (diff)
downloadkati-586b02a82282ac55f354a0b021ca695a8b3bf028.tar.gz
split -kati_eval_stats from -kati_stats
add shell func time (in eval time) in -kati_stats
Diffstat (limited to 'func.go')
-rw-r--r--func.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/func.go b/func.go
index e2352c8..214e6b5 100644
--- a/func.go
+++ b/func.go
@@ -10,6 +10,7 @@ import (
"sort"
"strconv"
"strings"
+ "time"
)
// Func is a make function.
@@ -660,6 +661,8 @@ func (f *funcOr) Eval(w io.Writer, ev *Evaluator) {
// http://www.gnu.org/software/make/manual/make.html#Shell-Function
type funcShell struct{ fclosure }
+var shellFuncTime time.Duration
+
func (f *funcShell) Arity() int { return 1 }
func (f *funcShell) Eval(w io.Writer, ev *Evaluator) {
@@ -680,7 +683,9 @@ func (f *funcShell) Eval(w io.Writer, ev *Evaluator) {
Args: cmdline,
Stderr: os.Stderr,
}
+ t := time.Now()
out, err := cmd.Output()
+ shellFuncTime += time.Now().Sub(t)
if err != nil {
Log("$(shell %q) failed: %q", arg, err)
}