-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally rely on cl-trivial-clock for more accurate timestamps
- Loading branch information
Showing
5 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
;;;; non-frugal/accurate-clock.lisp | ||
|
||
(in-package #:frugal-uuid) | ||
|
||
(defconstant +unix-epoch-offset-seconds+ 12219292800) | ||
|
||
(defun get-accurate-timestamp () | ||
(multiple-value-bind (seconds nanos) (trivial-clock:now) | ||
(+ (* (+ seconds +unix-epoch-offset-seconds+) 10000000) | ||
(floor nanos 100)))) | ||
|
||
(defun make-accurate-v1-generator (&key node-id clock-seq) | ||
(make-v1-generator :node-id node-id | ||
:clock-seq clock-seq | ||
:timestamp-generator #'get-accurate-timestamp)) | ||
|
||
(setf *v1-generator* nil | ||
*v1-generator-init-function* #'make-accurate-v1-generator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters