initial commit

This commit is contained in:
2017-03-30 01:09:55 +01:00
commit ce38f0ec96
134 changed files with 34785 additions and 0 deletions

28
vendor/github.com/valyala/fasthttp/coarseTime.go generated vendored Normal file
View File

@@ -0,0 +1,28 @@
package fasthttp
import (
"sync/atomic"
"time"
)
// CoarseTimeNow returns the current time truncated to the nearest second.
//
// This is a faster alternative to time.Now().
func CoarseTimeNow() time.Time {
tp := coarseTime.Load().(*time.Time)
return *tp
}
func init() {
t := time.Now().Truncate(time.Second)
coarseTime.Store(&t)
go func() {
for {
time.Sleep(time.Second)
t := time.Now().Truncate(time.Second)
coarseTime.Store(&t)
}
}()
}
var coarseTime atomic.Value