Merge pull request #71 from prometheus/beorn7/timestamp
Remove obsolete comment and add Earliest and Latest timestamp.
This commit is contained in:
commit
6760c3aacd
|
@ -14,18 +14,14 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
native_time "time"
|
native_time "time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO(julius): Should this use milliseconds/nanoseconds instead? This is
|
// Timestamp is the number of milliseconds since the epoch
|
||||||
// mostly hidden from the user of these types when using the
|
// (1970-01-01 00:00 UTC) excluding leap seconds.
|
||||||
// methods below, so it will be easy to change this later
|
|
||||||
// without requiring significant user code changes.
|
|
||||||
|
|
||||||
// Timestamp is the number of seconds since the epoch (1970-01-01 00:00 UTC)
|
|
||||||
// without leap seconds.
|
|
||||||
type Timestamp int64
|
type Timestamp int64
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -36,6 +32,13 @@ const (
|
||||||
second = int64(native_time.Second / MinimumTick)
|
second = int64(native_time.Second / MinimumTick)
|
||||||
// The number of nanoseconds per minimum tick.
|
// The number of nanoseconds per minimum tick.
|
||||||
nanosPerTick = int64(MinimumTick / native_time.Nanosecond)
|
nanosPerTick = int64(MinimumTick / native_time.Nanosecond)
|
||||||
|
|
||||||
|
// Earliest is the earliest timestamp representable. Handy for
|
||||||
|
// initializing a high watermark.
|
||||||
|
Earliest = Timestamp(math.MinInt64)
|
||||||
|
// Latest is the latest timestamp representable. Handy for initializing
|
||||||
|
// a low watermark.
|
||||||
|
Latest = Timestamp(math.MaxInt64)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Equal reports whether two timestamps represent the same instant.
|
// Equal reports whether two timestamps represent the same instant.
|
||||||
|
|
Loading…
Reference in New Issue