MCPcopy Create free account
hub / github.com/Monibuca/engine / ComputeBPS

Method ComputeBPS

track/base.go:30–42  ·  view source on GitHub ↗
(bytes int)

Source from the content-addressed store, hash-verified

28}
29
30func (bt *Base[T, F]) ComputeBPS(bytes int) {
31 bt.bytes += bytes
32 bt.frames++
33 if elapse := time.Since(bt.ts).Seconds(); elapse > 1 {
34 bt.BPS = int(float64(bt.bytes) / elapse)
35 bt.FPS = int(float64(bt.frames) / elapse)
36 bt.Drops = int(float64(bt.DropCount) / elapse)
37 bt.bytes = 0
38 bt.frames = 0
39 bt.DropCount = 0
40 bt.ts = time.Now()
41 }
42}
43
44func (bt *Base[T, F]) GetName() string {
45 return bt.Name

Callers 1

FlushMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected