Documentation ¶
Index ¶
- func DurationToMS(duration time.Duration) int64
- func HasEmptyString(strs ...string) bool
- func Memset(data []float64, value float64)
- func MemsetInt(data []int, value int)
- func ParseDurationString(s string) (time.Duration, error)
- func ParseTimeString(s string) (time.Time, error)
- func ParseTimeStringWithDefault(s string, defaultTime time.Time) (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationToMS ¶
DurationToMS converts a duration into milliseconds
func HasEmptyString ¶
HasEmptyString returns whether there are any empty strings in given strings
func Memset ¶ added in v0.15.0
Memset is a faster way to initialize a float64 array. NB: Inspired from https://github.com/tmthrgd/go-memset, which works directly on the byte interface. The 0 case is optimized due to https://github.com/golang/go/issues/5373 but for non the zero case, we use the copy() optimization. BenchmarkMemsetZeroValues-4 1000000 1344 ns/op BenchmarkLoopZeroValues-4 500000 3217 ns/op BenchmarkMemsetNonZeroValues-4 1000000 1537 ns/op BenchmarkLoopNonZeroValues-4 500000 3236 ns/op
func ParseDurationString ¶ added in v0.15.6
ParseDurationString parses a string duration allows for float seconds and also time strings such as 7d5h, etc.
func ParseTimeString ¶
ParseTimeString parses a time string into time.Time.
Types ¶
This section is empty.