go(plot): track plotting execution time
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-08 19:22:09 +02:00
parent d2ab681218
commit bec2ee3046
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -6,6 +6,7 @@ package algo
import ( import (
"fmt" "fmt"
"log" "log"
"time"
"git.dotya.ml/wanderer/math-optim/stats" "git.dotya.ml/wanderer/math-optim/stats"
"gonum.org/v1/gonum/floats" "gonum.org/v1/gonum/floats"
@ -20,6 +21,7 @@ const preferredFontStyle = "Mono"
// violating the limit of 30, TODO(me): split this up. // violating the limit of 30, TODO(me): split this up.
// nolint: gocognit // nolint: gocognit
func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string) { func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string) {
start := time.Now()
pWidth := 13 * vg.Centimeter pWidth := 13 * vg.Centimeter
pHeight := 13 * vg.Centimeter pHeight := 13 * vg.Centimeter
@ -95,7 +97,9 @@ func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string) {
fmt.Sprint(len(dim.Solution)) + "I" + fmt.Sprint(len(dim.Solution)) + "I" +
fExt fExt
info := "saving img to file: " + filename elapsed := time.Since(start)
info := "saving img to file: " + filename +
" [generated in " + fmt.Sprint(elapsed) + "]"
if s.Algo == "Random Search" { if s.Algo == "Random Search" {
printRandomSearch(info) printRandomSearch(info)