susumu.yata
null+****@clear*****
Mon Mar 23 14:07:57 JST 2015
susumu.yata 2015-03-23 14:07:57 +0900 (Mon, 23 Mar 2015) New Revision: d9ab1a95e0d3ec5c53410f17f5fab3ed8f0e5dfc https://github.com/groonga/grnxx/commit/d9ab1a95e0d3ec5c53410f17f5fab3ed8f0e5dfc Message: Gnx: print elapsed time in benchmark. Modified files: go/benchmark.go Modified: go/benchmark.go (+4 -0) =================================================================== --- go/benchmark.go 2015-03-20 21:45:00 +0900 (8568cc1) +++ go/benchmark.go 2015-03-23 14:07:57 +0900 (ee64e90) @@ -12,6 +12,7 @@ import "runtime" import "runtime/pprof" import "strconv" import "strings" +import "time" import "unicode" var flagMode = flag.String("mode", "run", "mode (run or print)") @@ -132,11 +133,14 @@ func runCommands(commands []string) { } defer os.RemoveAll(dir) defer db.Close() + startTime := time.Now() for _, command := range commands { if _, err := db.Query(command); err != nil { log.Fatalln(err) } } + endTime := time.Now() + fmt.Println("elapsed:", endTime.Sub(startTime)) } func printCommands(commands []string) { -------------- next part -------------- HTML����������������������������... 下载