util

package
v0.15.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationToMS

func DurationToMS(duration time.Duration) int64

DurationToMS converts a duration into milliseconds

func HasEmptyString

func HasEmptyString(strs ...string) bool

HasEmptyString returns whether there are any empty strings in given strings

func Memset added in v0.15.0

func Memset(data []float64, value float64)

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 MemsetInt added in v0.15.0

func MemsetInt(data []int, value int)

MemsetInt is a faster way to initialize an int array.

func ParseTimeString

func ParseTimeString(s string) (time.Time, error)

ParseTimeString parses a time string into time.Time

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL