time

package
v0.26.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonical

func Canonical(t time.Time) time.Time

Canonical returns UTC time with no monotonic component. Stripping the monotonic component is for time equality. See https://github.com/tendermint/tendermint/pull/2203#discussion_r215064334

func Now

func Now() time.Time

Now returns the current time in UTC with no monotonic component.

func WeightedMedian

func WeightedMedian(weightedTimes []*WeightedTime, totalVotingPower int64) (res time.Time)

WeightedMedian computes weighted median time for a given array of WeightedTime and the total voting power.

Types

type WeightedTime

type WeightedTime struct {
	Time   time.Time
	Weight int64
}

WeightedTime for computing a median.

func NewWeightedTime

func NewWeightedTime(time time.Time, weight int64) *WeightedTime

NewWeightedTime with time and weight.

Jump to

Keyboard shortcuts

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