more testing prints now in lex

This commit is contained in:
Ella Pietraroia 2020-01-20 15:45:43 +10:30
parent c99d3564bf
commit 0c081e0b23
2 changed files with 8 additions and 3 deletions

View File

@ -38,6 +38,8 @@ import (
)
var noDelay = make(chan time.Time)
var frameGet int = 0
var frameSend int = 0
func init() {
close(noDelay)
@ -62,6 +64,7 @@ func Lex(dst io.Writer, src io.Reader, delay time.Duration) error {
if n < 2 {
return nil
}
frameGet++
if err != nil {
if err == io.EOF {
return nil
@ -88,6 +91,8 @@ func Lex(dst io.Writer, src io.Reader, delay time.Duration) error {
}
<-tick
_, err = dst.Write(buf)
frameSend++
fmt.Printf("frames into lex: %v frames getting written: %v\t|\t", frameGet, frameSend)
if err != nil {
return err
}

View File

@ -93,7 +93,7 @@ func (m *MOGFilter) Write(f []byte) (int, error) {
frames++
fmt.Printf("Hold in array 1 frame:\t%dms\n", time.Now().Sub(t2).Milliseconds())
if frames >= 24 {
fmt.Printf("25 frames takes: %dms\n\n", time.Now().Sub(t1).Milliseconds())
fmt.Printf("\t\t\t\t\t\t\t\t25 frames takes: %dms\n\n", time.Now().Sub(t1).Milliseconds())
frames = 0
}
return 0, nil
@ -153,7 +153,7 @@ func (m *MOGFilter) Write(f []byte) (int, error) {
frames++
fmt.Printf("No motion 1 frame:\t%dms\n", time.Now().Sub(t2).Milliseconds())
if frames >= 24 {
fmt.Printf("25 frames takes: %dms\n\n", time.Now().Sub(t1).Milliseconds())
fmt.Printf("\t\t\t\t\t\t\t\t25 frames takes: %dms\n\n", time.Now().Sub(t1).Milliseconds())
frames = 0
}
return 0, nil
@ -170,7 +170,7 @@ func (m *MOGFilter) Write(f []byte) (int, error) {
fmt.Printf("Motion 1 frame:\t\t%dms\n", time.Now().Sub(t2).Milliseconds())
frames++
if frames >= 24 {
fmt.Printf("25 frames takes: %dms\n\n", time.Now().Sub(t1).Milliseconds())
fmt.Printf("\t\t\t\t\t\t\t\t25 frames takes: %dms\n\n", time.Now().Sub(t1).Milliseconds())
frames = 0
}
return m.dst.Write(f)