packagempbimport("io""time")// proxyReader is io.Reader wrapper, for proxy read bytestypeproxyReaderstruct{io.ReadCloserbar*BariTtime.Time}func(pr*proxyReader)Read(p[]byte)(nint,errerror){n,err=pr.ReadCloser.Read(p)ifn>0{pr.bar.IncrBy(n,time.Since(pr.iT))pr.iT=time.Now()}return}