File: styled_perf_bug.ml

package info (click to toggle)
ocaml-fmt 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 236 kB
  • sloc: ml: 1,267; makefile: 15
file content (11 lines) | stat: -rw-r--r-- 293 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
let n = 10000

let () =
  for _i = 1 to 10 do
    let t0 = Unix.gettimeofday () in
    for _i = 1 to n do
      ignore @@ Fmt.str "Hello %a" Fmt.string "world"
    done;
    let t1 = Unix.gettimeofday () in
    Printf.printf "Formatted %.0f messages/second\n%!" (float n /. (t1 -. t0))
  done