aboutsummaryrefslogtreecommitdiffstats
path: root/util/lamport/lamport.go
diff options
context:
space:
mode:
Diffstat (limited to 'util/lamport/lamport.go')
-rw-r--r--util/lamport/lamport.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/lamport/lamport.go b/util/lamport/lamport.go
index 640c58bc..0372bb6f 100644
--- a/util/lamport/lamport.go
+++ b/util/lamport/lamport.go
@@ -41,12 +41,15 @@ type Clock struct {
// Time is the value of a Clock.
type Time uint64
+// NewClock create a new clock with the value 1.
+// Value 0 is considered as invalid.
func NewClock() Clock {
return Clock{
counter: 1,
}
}
+// NewClockWithTime create a new clock with a value.
func NewClockWithTime(time uint64) Clock {
return Clock{
counter: time,