MCPcopy
hub / github.com/google/uuid / getTime

Function getTime

time.go:51–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func getTime() (Time, uint16, error) {
52 t := timeNow()
53
54 // If we don't have a clock sequence already, set one.
55 if clockSeq == 0 {
56 setClockSequence(-1)
57 }
58 now := uint64(t.UnixNano()/100) + g1582ns100
59
60 // If time has gone backwards with this clock sequence then we
61 // increment the clock sequence
62 if now <= lasttime {
63 clockSeq = ((clockSeq + 1) & 0x3fff) | 0x8000
64 }
65 lasttime = now
66 return Time(now), clockSeq, nil
67}
68
69// ClockSequence returns the current clock sequence, generating one if not
70// already set. The clock sequence is only used for Version 1 UUIDs.

Callers 1

GetTimeFunction · 0.85

Calls 2

setClockSequenceFunction · 0.85
TimeTypeAlias · 0.85

Tested by

no test coverage detected