Commit | Line | Data |
---|---|---|
c6a7396e SK |
1 | module Span = struct |
2 | type t = float | |
3 | ||
4 | let of_string s = | |
5 | float_of_string s | |
6 | ||
7 | let is_gt_or_eq t1 t2 = | |
8 | t1 >= t2 | |
9 | end | |
10 | ||
11 | type t = float | |
12 | ||
13 | let init = 0.0 | |
14 | ||
15 | let diff t0 t1 = | |
16 | t1 -. t0 | |
17 | ||
18 | let to_string t = | |
19 | Printf.sprintf "%f" t | |
20 | |> String.split_on_char '.' | |
21 | |> List.hd | |
22 | ||
23 | let of_string s = | |
6f35286a | 24 | (* TODO: Shall we validate time string format at msg parse time? *) |
c6a7396e | 25 | float_of_string s |