diff --git a/bql/planner/planner.go b/bql/planner/planner.go index b452bb08..f3cb09ea 100644 --- a/bql/planner/planner.go +++ b/bql/planner/planner.go @@ -811,7 +811,7 @@ func (p *queryPlan) processGraphPattern(ctx context.Context, lo *storage.LookupO addFilterOptions(lo, cls, filterOptionsByClause) unresolvable, err := p.processClause(ctx, cls, lo) resetFilterOptions(lo) - tElapsedCurrClause := time.Now().Sub(tStartCurrClause) + tElapsedCurrClause := time.Since(tStartCurrClause) tracer.V(2).Trace(p.tracer, func() *tracer.Arguments { return &tracer.Arguments{ @@ -826,7 +826,7 @@ func (p *queryPlan) processGraphPattern(ctx context.Context, lo *storage.LookupO return nil } } - tElapsedClauses := time.Now().Sub(tStartClauses) + tElapsedClauses := time.Since(tStartClauses) tracer.V(2).Trace(p.tracer, func() *tracer.Arguments { return &tracer.Arguments{ Msgs: []string{fmt.Sprintf("Finished processing all clauses, total latency: %v", tElapsedClauses)}, diff --git a/tools/vcli/bw/benchmark/benchmark.go b/tools/vcli/bw/benchmark/benchmark.go index 7d0ee48f..388f83a5 100644 --- a/tools/vcli/bw/benchmark/benchmark.go +++ b/tools/vcli/bw/benchmark/benchmark.go @@ -96,13 +96,13 @@ func runBattery(ctx context.Context, st storage.Store, name string, chanSize, bu fmt.Printf("Run %s benchmark sequentially... ", name) ts := time.Now() brs := runtime.RunBenchmarkBatterySequentially(bes) - ds := time.Now().Sub(ts) + ds := time.Since(ts) fmt.Printf("(%v) done\n", ds) fmt.Printf("Run %s benchmark concurrently... ", name) tc := time.Now() brc := runtime.RunBenchmarkBatteryConcurrently(bes) - dc := time.Now().Sub(tc) + dc := time.Since(tc) fmt.Printf("(%v) done\n\n", dc) format := func(br *runtime.BenchResult) string { diff --git a/tools/vcli/bw/repl/repl.go b/tools/vcli/bw/repl/repl.go index 1793657e..4c8eaac1 100644 --- a/tools/vcli/bw/repl/repl.go +++ b/tools/vcli/bw/repl/repl.go @@ -160,7 +160,7 @@ func REPL(od storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize, bu fmt.Println("Memoization enabled. Type help; to print help.") fmt.Println() defer func() { - fmt.Printf("\n\nThanks for all those BQL queries!\nSession duration: %v\n\n", time.Now().Sub(sessionStart)) + fmt.Printf("\n\nThanks for all those BQL queries!\nSession duration: %v\n\n", time.Since(sessionStart)) }() for l := range rl(done) { @@ -321,7 +321,7 @@ func REPL(od storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize, bu args := strings.Split("bw "+strings.TrimSpace(l)[:len(l)-1], " ") usage := "Wrong syntax\n\n\tload \n" export.Eval(ctx, usage, args, driver(), bulkSize) - fmt.Println("[OK] Time spent: ", time.Now().Sub(now)) + fmt.Println("[OK] Time spent: ", time.Since(now)) done <- false continue } @@ -330,7 +330,7 @@ func REPL(od storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize, bu args := strings.Split("bw "+strings.TrimSpace(l[:len(l)-1]), " ") usage := "Wrong syntax\n\n\tload \n" load.Eval(ctx, usage, args, driver(), bulkSize, builderSize) - fmt.Println("[OK] Time spent: ", time.Now().Sub(now)) + fmt.Println("[OK] Time spent: ", time.Since(now)) done <- false continue } @@ -355,28 +355,28 @@ func REPL(od storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize, bu } else { fmt.Printf("Loaded %q and run %d BQL commands successfully\n\n", path, cmds) } - fmt.Println("Time spent: ", time.Now().Sub(now)) + fmt.Println("Time spent: ", time.Since(now)) done <- false continue } now := time.Now() table, err := runBQL(ctx, l, driver(), chanSize, bulkSize, traceWriter) - bqlDiff := time.Now().Sub(now) + bqlDiff := time.Since(now) if err != nil { fmt.Printf("[ERROR] %s\n", err) - fmt.Println("Time spent: ", time.Now().Sub(now)) + fmt.Println("Time spent: ", time.Since(now)) fmt.Println() } else { if table == nil { fmt.Printf("[OK] 0 rows retrieved. BQL time: %v. Display time: %v\n", - bqlDiff, time.Now().Sub(now)-bqlDiff) + bqlDiff, time.Since(now)-bqlDiff) } else { if len(table.Bindings()) > 0 { fmt.Println(table.String()) } fmt.Printf("[OK] %d rows retrieved. BQL time: %v. Display time: %v\n", - table.NumRows(), bqlDiff, time.Now().Sub(now)-bqlDiff) + table.NumRows(), bqlDiff, time.Since(now)-bqlDiff) } } done <- false