File: unit_of_time.ml

package info (click to toggle)
ocaml-multicore-bench 0.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 320 kB
  • sloc: ml: 1,476; sh: 60; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 241 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
type t = [ `s | `ms | `mus | `ns ]

let to_multiplier = function
  | `s -> 1.0
  | `ms -> 1_000.0
  | `mus -> 1_000_000.0
  | `ns -> 1_000_000_000.0

let to_mnemonic = function
  | `s -> "s"
  | `ms -> "ms"
  | `mus -> "μs"
  | `ns -> "ns"