/fastime

Blazing Fast Time Library for golang

Primary LanguageGoMIT LicenseMIT

fastime License: MIT release CircleCI codecov Codacy Badge Go Report Card GoDoc Join the chat at https://gitter.im/kpango/fastime

Blazing Fast Time Library for golang with zero allocs

Requirement

Go 1.8

Installation

go get github.com/kpango/fastime

Example

    now := fastime.Now()
    defer fastime.Stop()

    // Create Instance
    ft := fastime.New()
    defer ft.Stop()
    ft.Now()

Benchmark

go test -count=5 -run=NONE -bench . -benchmem
goos: darwin
goarch: amd64
pkg: github.com/kpango/fastime
BenchmarkFastime-8   	2000000000	         0.47 ns/op	       0 B/op	       0 allocs/op
BenchmarkFastime-8   	2000000000	         0.48 ns/op	       0 B/op	       0 allocs/op
BenchmarkFastime-8   	2000000000	         0.48 ns/op	       0 B/op	       0 allocs/op
BenchmarkFastime-8   	2000000000	         0.47 ns/op	       0 B/op	       0 allocs/op
BenchmarkFastime-8   	2000000000	         0.47 ns/op	       0 B/op	       0 allocs/op
BenchmarkTime-8      	100000000	        16.6 ns/op	       1 B/op	       0 allocs/op
BenchmarkTime-8      	100000000	        15.4 ns/op	       1 B/op	       0 allocs/op
BenchmarkTime-8      	100000000	        15.6 ns/op	       1 B/op	       0 allocs/op
BenchmarkTime-8      	100000000	        15.6 ns/op	       1 B/op	       0 allocs/op
BenchmarkTime-8      	100000000	        14.9 ns/op	       1 B/op	       0 allocs/op
PASS
ok  	github.com/kpango/fastime	12.936s

Contribution

  1. Fork it ( https://github.com/kpango/fastime/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

kpango

LICENSE

fastime released under MIT license, refer LICENSE file.