File: unit_of_rate.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-- 233 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
type t = [ `_1 | `k | `M | `G ]

let to_divisor = function
  | `_1 -> 1.0
  | `k -> 1_000.0
  | `M -> 1_000_000.0
  | `G -> 1_000_000_000.0

let to_mnemonic = function
  | `_1 -> "1/s"
  | `k -> "k/s"
  | `M -> "M/s"
  | `G -> "G/s"