Added a logging system to show home much time it
took to do a certain part of the program
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"image/draw"
|
||||
"image/png"
|
||||
"maze-solver/maze"
|
||||
"maze-solver/utils"
|
||||
"os"
|
||||
|
||||
"github.com/mazznoer/colorgrad"
|
||||
@ -22,6 +23,7 @@ type ImageWriter struct {
|
||||
}
|
||||
|
||||
func (w *ImageWriter) Write() error {
|
||||
defer utils.Timer("Image writer", 3)()
|
||||
if w.Filename[len(w.Filename)-4:] != ".png" {
|
||||
return errors.New("Filename of ImageWriter doesn't have .png extension. The only suppported image type is png")
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"maze-solver/maze"
|
||||
"maze-solver/utils"
|
||||
)
|
||||
|
||||
type StringsWriter struct {
|
||||
@ -14,6 +15,7 @@ type StringsWriter struct {
|
||||
}
|
||||
|
||||
func (w *StringsWriter) Write() error {
|
||||
defer utils.Timer("Strings writer", 3)()
|
||||
w.lines = make([][]byte, w.Maze.Height)
|
||||
|
||||
// Fill the lines with walls
|
||||
|
Reference in New Issue
Block a user