diff --git a/flake.go b/flake.go index b205fd2..bb0e5ed 100644 --- a/flake.go +++ b/flake.go @@ -54,8 +54,28 @@ func NewFlakeNode(node int64) (*Node, error) { } // high performance generator +// well, that w as the idea... func (n *Node) Generator(c chan Flake) { + ticker := time.NewTicker(time.Millisecond) + now := int64(time.Now().UnixNano() / 1000000) + for { + + n.step = 0 + + select { + case c <- Flake((now-n.epoch)<