mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
don't fire a newly created timer
This commit is contained in:
parent
1045c7dc94
commit
072b84870c
2 changed files with 10 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
|||
package utils
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
|
||||
// A Timer wrapper that behaves correctly when resetting
|
||||
type Timer struct {
|
||||
|
@ -11,7 +14,7 @@ type Timer struct {
|
|||
|
||||
// NewTimer creates a new timer that is not set
|
||||
func NewTimer() *Timer {
|
||||
return &Timer{t: time.NewTimer(0)}
|
||||
return &Timer{t: time.NewTimer(time.Duration(math.MaxInt64))}
|
||||
}
|
||||
|
||||
// Chan returns the channel of the wrapped timer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue