Commit d154d355 authored by Etienne Renault's avatar Etienne Renault
Browse files

main: add compilation time & transpilation time

* main.go: Here.
parent ad9e11b0
......@@ -37,6 +37,7 @@ import (
"strconv"
"strings"
"text/template"
"time"
"golang.org/x/tools/go/ast/astutil"
......@@ -554,6 +555,7 @@ func init() {
func main() {
flag.Parse()
start := time.Now()
if *version { // Version preempt all
fmt.Println("Go2Pins, version go2pins" + go2pins_version + "\n")
......@@ -717,9 +719,18 @@ func main() {
copyFile(from, to, data)
}
transpile_time := time.Since(start)
start = time.Now()
fmt.Println("transpilation time: ", transpile_time.Milliseconds(), "ms")
// Ease users life, do not force them to make by themself
cmd := exec.Command("make", "-C", *output)
_, err = cmd.Output()
compilation_time := time.Since(start)
fmt.Println("compilation time: ", compilation_time.Milliseconds(), "ms")
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment