mirror of https://bitbucket.org/ausocean/av.git
more testing prints now in lex
This commit is contained in:
parent
c99d3564bf
commit
0c081e0b23
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue