add timestamps; use Ptime
This commit is contained in:
parent
112ece6d9a
commit
a27af0ecf1
8 changed files with 163 additions and 77 deletions
16
src/util.ml
16
src/util.ml
|
|
@ -1,8 +1,22 @@
|
|||
(* TODO *)
|
||||
module Protocol_version = struct
|
||||
(* TODO *)
|
||||
(* libtool version format *)
|
||||
let current = 0
|
||||
let revision = 0
|
||||
let age = 0
|
||||
let v = Fmt.str "%d:%d:%d"
|
||||
end
|
||||
|
||||
(* -- Ptime -- *)
|
||||
|
||||
let ptime_to_int64_us p = Int64.of_float (1_000_000. *. Ptime.to_float_s p)
|
||||
|
||||
let ptime_of_span_exn span =
|
||||
match Ptime.of_span span with
|
||||
| None -> Fmt.failwith "Ptime.of_span: not in the range [min;max]"
|
||||
| Some p -> p
|
||||
|
||||
let ptime_add_span_exn p span =
|
||||
match Ptime.add_span p span with
|
||||
| None -> Fmt.failwith "Ptime.add_span: not in the range [min;max]"
|
||||
| Some v -> v
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue