util

package
v0.0.0-...-bb75541 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID(shard int) int64

GenerateID generates a int64 id.

It is composed of unix timestamp, shard, and random number. For the first 42 bits is unix timestamp, the next 12 bits is shard, and the remaining 10 bits is a random number.

func MeasureExecTime

func MeasureExecTime(beginAt time.Time, name string) time.Duration

MeasureExecTime measures the duration from beginAt.

It is useful to be a defer statment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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