Skip to content

chentaihan/flowControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flowControl

流量控制器

滑动窗口实现流量控制

//qps = 1000/5 = 200
rw := NewRollWindow(5, 1000)
startTime := time.Now()
const count = 10000
for i := 0; i < count; i++ {
    rw.Wait()
}
useTime := time.Now().Sub(startTime)
fmt.Println(useTime)

Releases

No releases published

Packages

No packages published

Languages