mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-07 17:10:29 +00:00
feat: support max running tasks config (#112)
This commit is contained in:
1 parent
1e08ecd8db
commit
d9c5ca339f
22 files changed
+269
-129
No files matched your search
+6
-1
@@ -2,12 +2,17 @@ package util
|
||||
|
||||
import "time"
|
||||
|
||||
// 计时器
|
||||
type Timer struct {
|
||||
t int64
|
||||
used int64
|
||||
}
|
||||
|
||||
func NewTimer(used int64) *Timer {
|
||||
return &Timer{
|
||||
used: used,
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Timer) Start() {
|
||||
t.t = time.Now().UnixNano()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user